Merge pull request #161 from kevins90/fix_attr_name_as_serializer_underscored_prefix

Fix serialization of attribute whose name matches the serializer prefix underscored
This commit is contained in:
Steve Klabnik
2013-01-05 14:09:15 -08:00
3 changed files with 19 additions and 2 deletions

View File

@@ -226,7 +226,6 @@ module ActiveModel
name = klass.name.demodulize.underscore.sub(/_serializer$/, '')
klass.class_eval do
alias_method name.to_sym, :object
root name.to_sym unless self._root == false
end
end