Class: ActiveRecordCache::DefaultsHandler
- Inherits:
-
Object
- Object
- ActiveRecordCache::DefaultsHandler
- Defined in:
- lib/active_record_cache/defaults_handler.rb
Overview
Rack handler that sets the default for classes if they will use the cache for queries.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options) ⇒ DefaultsHandler
constructor
A new instance of DefaultsHandler.
Constructor Details
#initialize(app, options) ⇒ DefaultsHandler
Returns a new instance of DefaultsHandler.
4 5 6 7 |
# File 'lib/active_record_cache/defaults_handler.rb', line 4 def initialize(app, ) @app = app @options = end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 |
# File 'lib/active_record_cache/defaults_handler.rb', line 9 def call(env) ActiveRecordCache.enable_by_default_on(@options) do @app.call(env) end end |