From 0933b6d1ba78405cc376bf4ff256356135cd8c5e Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 21 Feb 2011 18:51:21 -0800 Subject: [PATCH] We already have the record; no need to retrieve it again --- activerecord/lib/active_record/serializers/xml_serializer.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/serializers/xml_serializer.rb b/activerecord/lib/active_record/serializers/xml_serializer.rb index f8e6cf958c..67f6c7833c 100644 --- a/activerecord/lib/active_record/serializers/xml_serializer.rb +++ b/activerecord/lib/active_record/serializers/xml_serializer.rb @@ -219,8 +219,8 @@ def add_associations(association, records, opts) end end end - elsif record = @serializable.send(association) - record.to_xml(merged_options) + else + records.to_xml(merged_options) end end -- GitLab