active_model_serializers/lib/active_model
Noah Silas 7bde7bf752 Handle conflicts between key names and serializer methods
As an example, all serializers implement `#object` as a reference to the
object being esrialized, but this was preventing adding a key to the
serialized representation with the `object` name.

Instead of having attributes directly map to methods on the serializer,
we introduce one layer of abstraction: the `_attributes_map`. This hash
maps the key names expected in the output to the names of the
implementing methods.

This simplifies some things (removing the need to maintain both
`_attributes` and `_attribute_keys`), but does add some complexity in
order to support overriding attributes by defining methods on the
serializer. It seems that with the addition of the inline-block format,
we may want to remove the usage of programatically defining methods on
the serializer for this kind of customization.
2015-12-02 17:20:22 -06:00
..
serializer Encapsulate serialized_associations; test inline associations 2015-12-02 17:20:22 -06:00
serializable_resource.rb Clean up notification code with some meta-prog 2015-11-10 03:09:24 -06:00
serializer.rb Handle conflicts between key names and serializer methods 2015-12-02 17:20:22 -06:00