From 9fdb4d9ae27d18ed452cebf41fb0d2f93ed21dbf Mon Sep 17 00:00:00 2001 From: Jared Grippe Date: Thu, 2 Oct 2008 15:27:02 -0700 Subject: [PATCH] fixed serialization of scoped model to xml root node bug --- .../active_record/serializers/xml_serializer.rb | 4 ++-- 1 files 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 d171b74..991b36e 100644 --- a/activerecord/lib/active_record/serializers/xml_serializer.rb +++ b/activerecord/lib/active_record/serializers/xml_serializer.rb @@ -177,7 +177,7 @@ module ActiveRecord #:nodoc: end def root - root = (options[:root] || @record.class.to_s.underscore).to_s + root = (options[:root] || @record.class_name.underscore).to_s dasherize? ? root.dasherize : root end @@ -230,7 +230,7 @@ module ActiveRecord #:nodoc: records.each do |record| record.to_xml opts.merge( :root => association_name, - :type => (record.class.to_s.underscore == association_name ? nil : record.class.name) + :type => (record.class_name.underscore == association_name ? nil : record.class.name) ) end end -- 1.5.5