Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (19 sloc) 337 Bytes
module Cache
class << self
attr_writer :perform_caching
end
self.perform_caching = false
def self.perform_caching?
@perform_caching
end
def self.store
Rails.cache
end
def self.fetch(key, options = {})
if perform_caching?
store.fetch(key, options) { yield }
else
yield
end
end
end
Jump to Line
Something went wrong with that request. Please try again.