rails/rails — pull request #7874 by Omer (2012-10-08 16:45:42+00:00)
Title: ActiveModel::Serializers::Xml should extend ActiveModel::Naming

Assuming a native Ruby class named `Foo` which includes only the following module `ActiveModel::Serializers::Xml`. If we call `#to_xml` on an instance of `Foo` we would get the following exception `NoMethodError (undefined method 'model_name'...`

One way to solve this issue would be to also make sure `Foo` also extend `ActiveModel::Naming`. Another way, which appear to be more robust, and more importantly, consistent with the rest of the codebase (i.e. already used in `ActiveModel::Serializers::JSON`) would be extend `ActiveModel::Naming` the moment `ActiveModel::Serializers::Xml` is included.