mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 14:29:31 +00:00
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. |
||
|---|---|---|
| .. | ||
| adapter_for_test.rb | ||
| association_macros_test.rb | ||
| associations_test.rb | ||
| attribute_test.rb | ||
| attributes_test.rb | ||
| cache_test.rb | ||
| configuration_test.rb | ||
| fieldset_test.rb | ||
| meta_test.rb | ||
| options_test.rb | ||
| root_test.rb | ||
| serializer_for_test.rb | ||