Move serializer caching from adapter

This commit is contained in:
Benjamin Fleischer
2016-01-27 15:03:34 -05:00
parent 093d198bc4
commit eda8ff1737
19 changed files with 247 additions and 297 deletions

View File

@@ -48,9 +48,12 @@ module ActiveModel
# @see ActiveModelSerializers::Adapter.lookup
# Deprecated
def self.adapter
warn 'Calling adapter method in Serializer, please use the ActiveModelSerializers::Adapter.configured_adapter'
ActiveModelSerializers::Adapter.lookup(config.adapter)
end
class << self
extend ActiveModelSerializers::Deprecate
deprecate :adapter, 'ActiveModelSerializers::Adapter.configured_adapter'
end
# @api private
def self.serializer_lookup_chain_for(klass)

View File

@@ -68,7 +68,7 @@ module ActiveModel
# @api private
# maps attribute value to explict key name
# @see Serializer::attribute
# @see Adapter::FragmentCache#fragment_serializer
# @see FragmentCache#fragment_serializer
def _attributes_keys
_attributes_data
.each_with_object({}) do |(key, attr), hash|