mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Fix caching issue happening with memory_store
It seems that fecthing from memory_store returns a reference to the object and not a copy. Since the Attributes adapter applies #merge! on the Hash that is returned from the memory_store, the value in the cache is also modified.
This commit is contained in:
committed by
Benjamin Fleischer
parent
d50d29b601
commit
fb62fb39b2
@@ -55,7 +55,7 @@ module ActiveModelSerializers
|
||||
def serializable_hash_for_single_resource(options)
|
||||
resource = resource_object_for(options)
|
||||
relationships = resource_relationships(options)
|
||||
resource.merge!(relationships)
|
||||
resource.merge(relationships)
|
||||
end
|
||||
|
||||
def resource_relationships(options)
|
||||
|
||||
Reference in New Issue
Block a user