active_model_serializers/test/serializers
Benjamin Fleischer d9e76c29d5 Make Adapters registerable so they are not namespace-constrained
Changes:

- Introduce Adapter::get for use by Serializer.adapter
- Move Adapter-finding logic from Adapter::adapter_class into Adapter::get

Introduced interfaces:

- non-inherited methods
```ruby
ActiveModel::Serializer::Adapter.adapter_map     # a Hash<adapter_name, adapter_class>
ActiveModel::Serializer::Adapter.adapters        # an Array<adapter_name>
ActiveModel::Serializer::Adapter.register(name, klass) # adds an adapter to the adapter_map
ActiveModel::Serializer::Adapter.get(name_or_klass)    # raises Argument error when adapter not found
```

- Automatically register adapters when subclassing

```ruby
      def self.inherited(subclass)
        ActiveModel::Serializer::Adapter.register(subclass.to_s.demodulize, subclass)
      end
```

- Preserves subclass method `::adapter_class(adapter)`

```ruby
      def self.adapter_class(adapter)
        ActiveModel::Serializer::Adapter.get(adapter)
      end
```

- Serializer.adapter now uses `Adapter.get(config.adapter)` rather than have duplicate logic
2015-09-08 22:59:36 -05:00
..
adapter_for_test.rb Make Adapters registerable so they are not namespace-constrained 2015-09-08 22:59:36 -05:00
association_macros_test.rb Remove traces of embed option. 2015-08-31 01:26:22 +02:00
associations_test.rb Rubocop: Consistent spacing 2015-09-03 20:51:40 -05:00
attribute_test.rb Rubocop: Consistent spacing 2015-09-03 20:51:40 -05:00
attributes_test.rb Merge remote-tracking branch 'upstream/master' into fix-jsonapi-ri 2015-09-06 17:21:43 +02:00
cache_test.rb Rubocop: Consistent spacing 2015-09-03 20:51:40 -05:00
configuration_test.rb updating tests to match new adapters structure 2015-06-15 13:39:36 -03:00
fieldset_test.rb Rubocop: Consistent spacing 2015-09-03 20:51:40 -05:00
meta_test.rb Rubocop: Consistent spacing 2015-09-03 20:51:40 -05: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 Add Style enforcer (via Rubocop) 2015-09-03 20:50:45 -05:00