Revert "Merge branch 'context'"

This reverts commit 1bd8180a94, reversing
changes made to 9bb32331f4.
This commit is contained in:
Santiago Pastorino
2014-01-07 15:02:09 -02:00
parent 1bd8180a94
commit ed9a5288f9
8 changed files with 51 additions and 72 deletions

View File

@@ -65,21 +65,11 @@ module ActionController
options = default_serializer_options.merge(options)
if serializer = options.fetch(:serializer, ActiveModel::Serializer.serializer_for(resource))
options[:context] = build_context_from options[:context]
options[:scope] = serialization_scope unless options.has_key?(:scope)
options[:resource_name] = controller_name if resource.respond_to?(:to_ary)
serializer.new(resource, options)
end
end
def build_context_from(context_option)
default_context.tap do |context|
context.merge! context_option if context_option
end
end
def default_context
{ scope: serialization_scope }
end
end
end