mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Fix issue with embedding multiple associations under the same root key
This commit is contained in:
@@ -204,7 +204,9 @@ end
|
||||
association_serializer = build_serializer(association)
|
||||
# we must do this always because even if the current association is not
|
||||
# embeded in root, it might have its own associations that are embeded in root
|
||||
hash.merge!(association_serializer.embedded_in_root_associations) {|key, oldval, newval| [newval, oldval].flatten }
|
||||
hash.merge!(association_serializer.embedded_in_root_associations) do |key, oldval, newval|
|
||||
oldval.merge(newval) { |_, oldval, newval| [oldval, newval].flatten.uniq }
|
||||
end
|
||||
|
||||
if association.embed_in_root?
|
||||
if association.embed_in_root_key?
|
||||
|
||||
Reference in New Issue
Block a user