lib/mongo_mapper/plugins/caching.rb in mongo_mapper-0.10.1 vs lib/mongo_mapper/plugins/caching.rb in mongo_mapper-0.11.0

- old
+ new

@@ -2,22 +2,20 @@ module MongoMapper module Plugins module Caching extend ActiveSupport::Concern - module InstanceMethods - 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 + 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 \ No newline at end of file