Merge pull request #880 from groyoh/serializer-inheritance

Inabling subclasses serializers to inherit attributes
This commit is contained in:
João Moura
2015-05-18 11:34:10 -03:00
4 changed files with 57 additions and 4 deletions

View File

@@ -22,9 +22,9 @@ module ActiveModel
end
def self.inherited(base)
base._attributes = []
base._attributes_keys = {}
base._associations = {}
base._attributes = self._attributes.try(:dup) || []
base._attributes_keys = self._attributes_keys.try(:dup) || {}
base._associations = self._associations.try(:dup) || {}
base._urls = []
end