Skip to content

Commit d6f7a4f

Browse files
committed
Switch to deep_merge for adding included_objects
as found in #802
1 parent 6d55697 commit d6f7a4f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/jsonapi/resource_serializer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def add_included_object(id, object_hash, primary = false)
348348
@included_objects[type] = {} unless @included_objects.key?(type)
349349

350350
if already_serialized?(type, id)
351-
@included_objects[type][id][:object_hash].merge!(object_hash)
351+
@included_objects[type][id][:object_hash].deep_merge!(object_hash)
352352
set_primary(type, id) if primary
353353
else
354354
@included_objects[type].store(id, primary: primary, object_hash: object_hash)

0 commit comments

Comments
 (0)