aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/serializers
diff options
context:
space:
mode:
authorLawrence Pit <lawrence.pit@gmail.com>2010-04-30 10:39:52 +1000
committerJosé Valim <jose.valim@gmail.com>2010-04-30 14:22:57 +0200
commit60504e62c8e2f5e137a0ac82aed67a6c0fe42447 (patch)
tree2aad838d8b81c73c7b3c47d39310a6f4b8aead41 /activerecord/lib/active_record/serializers
parenta003a39bac204b6b2d6425fa3c10891a0cf0149a (diff)
downloadrails-60504e62c8e2f5e137a0ac82aed67a6c0fe42447.tar.gz
rails-60504e62c8e2f5e137a0ac82aed67a6c0fe42447.tar.bz2
rails-60504e62c8e2f5e137a0ac82aed67a6c0fe42447.zip
to_xml with :include should skip_instruct on the included records [#4506 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/lib/active_record/serializers')
-rw-r--r--activerecord/lib/active_record/serializers/xml_serializer.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/serializers/xml_serializer.rb b/activerecord/lib/active_record/serializers/xml_serializer.rb
index ed5964d923..b2d4a48945 100644
--- a/activerecord/lib/active_record/serializers/xml_serializer.rb
+++ b/activerecord/lib/active_record/serializers/xml_serializer.rb
@@ -197,7 +197,7 @@ module ActiveRecord #:nodoc:
# TODO This can likely be cleaned up to simple use ActiveSupport::XmlMini.to_tag as well.
def add_associations(association, records, opts)
association_name = association.to_s.singularize
- merged_options = options.merge(opts).merge!(:root => association_name)
+ merged_options = options.merge(opts).merge!(:root => association_name, :skip_instruct => true)
if records.is_a?(Enumerable)
tag = ActiveSupport::XmlMini.rename_key(association.to_s, options)