Sha256: 6a51de06980799c805d72b517ddee0fee9b6dd83ce1ced4b62c0e148ad5c1962
Contents?: true
Size: 624 Bytes
Versions: 60
Compression:
Stored size: 624 Bytes
Contents
# encoding: UTF-8 module MongoMapper module Plugins module Caching module InstanceMethods def cache_key(*suffixes) cache_key = case when new? "#{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 end
Version data entries
60 entries across 60 versions & 7 rubygems