Sha256: 86ebc74863244339aab24cb1a0777076547d01d463303fca112ca4b0f9d2b462
Contents?: true
Size: 605 Bytes
Versions: 18
Compression:
Stored size: 605 Bytes
Contents
# encoding: UTF-8 module MongoMapper module Plugins module Caching extend ActiveSupport::Concern def cache_key(*suffixes) cache_key = case when !persisted? "#{self.class.name}/new" when timestamp = self[:updated_at] "#{self.class.name}/#{id}-#{timestamp.to_s(:number)}" else "#{self.class.name}/#{id}" end cache_key += "/#{suffixes.join('/')}" unless suffixes.empty? cache_key end end end end
Version data entries
18 entries across 18 versions & 3 rubygems