mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
The Array serializer should not make a child root for every item in the Array
This commit is contained in:
@@ -26,7 +26,8 @@ module ActiveModel
|
||||
|
||||
def as_json(*args)
|
||||
@hash = {}
|
||||
array = serializable_array.as_json(*args)
|
||||
|
||||
array = serializable_array.map(&:serializable_hash)
|
||||
|
||||
if root = @options[:root]
|
||||
@hash.merge!(root => array)
|
||||
|
||||
Reference in New Issue
Block a user