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:
@@ -16,6 +16,7 @@ module ActiveModel
|
||||
@object = object
|
||||
@root = options[:root]
|
||||
@root = self.class._root if @root.nil?
|
||||
@root = options[:resource_name] if @root.nil?
|
||||
@meta_key = options[:meta_key] || :meta
|
||||
@meta = options[@meta_key]
|
||||
@each_serializer = options[:each_serializer]
|
||||
|
||||
Reference in New Issue
Block a user