active_model_serializers/test/serializers
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
..
adapter_for_test.rb Introduce Adapter::Base 2015-09-20 12:26:04 -05:00
association_macros_test.rb Remove traces of embed option. 2015-08-31 01:26:22 +02:00
associations_test.rb Encapsulate serialized_associations; test inline associations 2015-12-02 17:20:22 -06:00
attribute_test.rb Handle conflicts between key names and serializer methods 2015-12-02 17:20:22 -06:00
attributes_test.rb Extract attributes filtering from serializer into adapter. 2015-10-05 08:21:26 +02:00
cache_test.rb Match file paths with spaces in caller regexp 2015-12-02 06:17:34 -07:00
configuration_test.rb Rename ArraySerializer to CollectionSerializer for clarity 2015-10-21 16:53:26 -05:00
fieldset_test.rb Extract attributes filtering from serializer into adapter. 2015-10-05 08:21:26 +02:00
meta_test.rb Move meta/meta_key handling inside adapter. 2015-10-05 19:06:50 +02:00
options_test.rb Makes passed in options accessible inside serializers 2015-03-11 14:53:57 -03:00
root_test.rb Rubocop: Consistent spacing 2015-09-03 20:51:40 -05:00
serializer_for_test.rb Only use subclasses of ActiveModel::Serializer during lookup. 2015-10-23 17:17:03 +02:00