The current documentation stated that it was not possible to override
the root key for the JSON adapter. This was removed from the
documentation and it now links the useful documentation pages.
Changed the namespace in adapters and folder to active_model_serializers from active_model::serializer
Changed namespace of adapters in serializers and other folders
Moved adapter_for_test file to active_model_serializers folder and changed namespace of adapter inside the test file
Require ActiveSupport's string/inflections
We depend on string/inflections to define String#underscore.
Refactor JsonApi adapter to avoid redundant computations.
Update readme.md to link to v0.10.0.rc4
changed namespace of adapter folder testcases
Changed all namespaces of adapter under active_moder_serializers
Namespaced IncludeTree which is from serializer module, so needed to namespace it properly
Fixed wrong namsepacing of fieldset
namespace change in deserializer json_api
Fixed the namespace for collection serializer when used inside adapter, changed namespace for adapter to new namespace which I had forgotten previously
Modified logging test and adapter test cases to make the testcases pass
Changed the yardoc links,as old links are not taking to documentation pages,proper links for 0.10,0.9 and 0.8 in rubydoc
Rubocop errors are fixed by underscore naming unused variables
Moved the require of adapter to serializable resource
Remoeved adapter dependency inside serializer and added warning to Serializer::adapter method
Fixed frament cache test which is calling Serializer.adapter
Changed the name of lookup_adapter_from_config to configured_adapter
Changed the docs which will show the new namespace of adapters
Rubocop fix
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