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:
Yohan Robert
2016-03-30 11:10:36 +02:00
committed by Benjamin Fleischer
parent d50d29b601
commit fb62fb39b2
2 changed files with 2 additions and 2 deletions

View File

@@ -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)