diff options
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/lib/active_model/serializers/xml.rb | 2 | ||||
-rw-r--r-- | activemodel/test/cases/serializeration/xml_serialization_test.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/serializers/xml.rb b/activemodel/lib/active_model/serializers/xml.rb index df7026b3ec..934af2b8a8 100644 --- a/activemodel/lib/active_model/serializers/xml.rb +++ b/activemodel/lib/active_model/serializers/xml.rb @@ -90,7 +90,7 @@ module ActiveModel @builder = options[:builder] @builder.instruct! unless options[:skip_instruct] - root = (options[:root] || @serializable.class.model_name.singular).to_s + root = (options[:root] || @serializable.class.model_name.element).to_s root = ActiveSupport::XmlMini.rename_key(root, options) args = [root] diff --git a/activemodel/test/cases/serializeration/xml_serialization_test.rb b/activemodel/test/cases/serializeration/xml_serialization_test.rb index 3ba826a8d0..4e8e4efa25 100644 --- a/activemodel/test/cases/serializeration/xml_serialization_test.rb +++ b/activemodel/test/cases/serializeration/xml_serialization_test.rb @@ -37,8 +37,8 @@ class XmlSerializationTest < ActiveModel::TestCase test "should serialize namespaced root" do @xml = Admin::Contact.new(@contact.attributes).to_xml - assert_match %r{^<admin-contact>}, @xml - assert_match %r{</admin-contact>$}, @xml + assert_match %r{^<contact>}, @xml + assert_match %r{</contact>$}, @xml end test "should serialize default root with namespace" do |