active_model_serializers/lib
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
..
action_controller Update for review per maurogeorge feedback 2015-11-19 12:41:51 -06:00
active_model Handle conflicts between key names and serializer methods 2015-12-02 17:20:22 -06:00
active_model_serializers Fix typo 2015-11-24 07:22:59 -08:00
generators/serializer fix description of USAGE 2015-12-01 08:54:27 +09:00
active_model_serializers.rb Move caching initialization to Railtie 2015-11-25 21:56:01 -06:00