Move the default value to the options param

This commit is contained in:
Santiago Pastorino 2014-01-03 20:02:43 -02:00
parent 5fa4002039
commit 78245b07bc

View File

@ -61,8 +61,8 @@ module ActionController
send(_serialization_scope) if _serialization_scope && respond_to?(_serialization_scope, true)
end
def build_json_serializer(resource, options)
options = default_serializer_options.merge(options || {})
def build_json_serializer(resource, options = {})
options = default_serializer_options.merge(options)
if serializer = options.fetch(:serializer, ActiveModel::Serializer.serializer_for(resource))
options[:scope] = serialization_scope unless options.has_key?(:scope)