mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Allow users to globally opt out of automatic lookup
This commit is contained in:
committed by
Benjamin Fleischer
parent
8aaaa44ba3
commit
170db3ba88
@@ -21,6 +21,10 @@ module ActionController
|
||||
end
|
||||
|
||||
def get_serializer(resource, options = {})
|
||||
unless options[:serializer] || options[:each_serializer] || ActiveModel::Serializer.config.automatic_lookup
|
||||
return resource
|
||||
end
|
||||
|
||||
if !use_adapter?
|
||||
warn 'ActionController::Serialization#use_adapter? has been removed. '\
|
||||
"Please pass 'adapter: false' or see ActiveSupport::SerializableResource.new"
|
||||
|
||||
@@ -20,6 +20,7 @@ module ActiveModel
|
||||
|
||||
config.adapter = :attributes
|
||||
config.jsonapi_resource_type = :plural
|
||||
config.automatic_lookup = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user