mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Use controller name as root when serializing an array and not root is defined
This commit is contained in:
@@ -71,6 +71,7 @@ module ActionController
|
||||
return unless serializer
|
||||
|
||||
options[:scope] = serialization_scope unless options.has_key?(:scope)
|
||||
options[:resource_name] = self.controller_name if resource.respond_to?(:to_ary)
|
||||
|
||||
serializer.new(resource, options)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user