active_model_serializers/test
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
..
action_controller Add tests for fields option demonstrating usage on both attributes and relationships (#1839) 2016-08-17 16:12:12 -05:00
active_model_serializers Support key transformation for Attributes adapter (#1889) 2016-08-25 15:21:27 -04:00
adapter Support key transformation for Attributes adapter (#1889) 2016-08-25 15:21:27 -04:00
benchmark remove dynamic class creation where not needed (#1850) 2016-07-18 14:11:09 -05:00
fixtures remove dynamic class creation where not needed (#1850) 2016-07-18 14:11:09 -05:00
generators Only load generators when needed 2016-01-15 01:52:27 -06:00
serializers remove dynamic class creation where not needed (#1850) 2016-07-18 14:11:09 -05:00
support Correct typos 2016-08-16 18:18:58 -05:00
active_record_test.rb Favor ActiveSupport::TestCase over Minitest::Test 2015-12-22 10:35:51 -06:00
adapter_test.rb re: RuboCop - get rid of redundant curly braces around a hash parameter 2016-06-20 22:14:39 +01:00
array_serializer_test.rb Drop support for Rails 4.0 and Ruby 2.0.0 2016-04-04 11:41:35 -06:00
cache_test.rb Use ActiveSupport::Cache.expand_cache_key for cache key expansions (#1878) 2016-08-13 16:59:36 -05:00
collection_serializer_test.rb remove dynamic class creation where not needed (#1850) 2016-07-18 14:11:09 -05:00
grape_test.rb re: RuboCop - Use nested module/class definition instead of compact style. 2016-06-20 22:15:20 +01:00
lint_test.rb re: RuboCop: Bulk minor style corrections 2016-06-20 22:12:16 +01:00
logger_test.rb re: RuboCop - Use nested module/class definition instead of compact style. 2016-06-20 22:15:20 +01:00
poro_test.rb Favor ActiveSupport::TestCase over Minitest::Test 2015-12-22 10:35:51 -06:00
serializable_resource_test.rb re: RuboCop - get rid of redundant curly braces around a hash parameter 2016-06-20 22:14:39 +01:00
test_helper.rb Restrict serializable_hash to accepted options, only for tests 2016-04-13 00:40:57 -05:00