active_model_serializers/test/active_model_serializers
Ian C. Anderson 2423ca4999 Support key transformation for Attributes adapter (#1889)
The `:attributes` adapter is the default one, but it did not support
key transformation. This was very surprising behavior, since the
"Configuration Options" page in the guides didn't mention that this
behavior was not supported by the attributes adapter.

This commit adds key transform support to the attributes adapter, and
adds documentation about the default transform for the attributes
adapter (which is `:unaltered`).

This commit also handles arrays when transforming keys, which was needed
in the case where you're serializing a collection with the Attributes
adapter. With the JSON adapter, it was always guaranteed to pass a hash
to the KeyTransform functions because of the top-level key. Since there
is no top-level key for the Attributes adapter, the return value could
be an array.
2016-08-25 15:21:27 -04:00
..
test Include actual exception message with custom exceptions 2016-05-17 10:32:53 -05:00
adapter_for_test.rb Add missing object context needed for tests to be run alone 2016-03-25 00:20:10 -05:00
json_pointer_test.rb re: RuboCop - Use nested module/class definition instead of compact style. 2016-06-20 22:15:20 +01:00
key_transform_test.rb Support key transformation for Attributes adapter (#1889) 2016-08-25 15:21:27 -04:00
logging_test.rb Move SerializableResource to ActiveModelSerializers namespace 2016-03-30 11:33:04 +02:00
model_test.rb ActiveModelSerializers::Model successor initialized with string keys fix (#1881) 2016-08-16 06:49:10 -04:00
railtie_test_isolated.rb Provide Rails url_helpers via SerializationContext 2016-03-07 10:40:34 -07:00
register_jsonapi_renderer_test_isolated.rb re: RuboCop - replace rocket style hashes 2016-06-20 22:14:12 +01:00
serialization_context_test_isolated.rb Fix #1759, Grape integration, adds serialization_context 2016-06-14 09:45:30 -05:00