Class: ActiveSupport::Cache::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/active_support/cache/libmemcached_store.rb

Instance Method Summary collapse

Instance Method Details

#value_with_dupObject

In 3.0 all values returned from Rails.cache.read are frozen. This makes sense for an in-memory store storing object references, but for a marshalled store we should be able to modify things.



18
19
20
21
# File 'lib/active_support/cache/libmemcached_store.rb', line 18

def value_with_dup
  result = value_without_dup
  result.duplicable? ? result.dup : result
end