mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 23:06:50 +00:00
Move the default value to the options param
This commit is contained in:
parent
5fa4002039
commit
78245b07bc
@ -61,8 +61,8 @@ module ActionController
|
|||||||
send(_serialization_scope) if _serialization_scope && respond_to?(_serialization_scope, true)
|
send(_serialization_scope) if _serialization_scope && respond_to?(_serialization_scope, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_json_serializer(resource, options)
|
def build_json_serializer(resource, options = {})
|
||||||
options = default_serializer_options.merge(options || {})
|
options = default_serializer_options.merge(options)
|
||||||
|
|
||||||
if serializer = options.fetch(:serializer, ActiveModel::Serializer.serializer_for(resource))
|
if serializer = options.fetch(:serializer, ActiveModel::Serializer.serializer_for(resource))
|
||||||
options[:scope] = serialization_scope unless options.has_key?(:scope)
|
options[:scope] = serialization_scope unless options.has_key?(:scope)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user