Class: ActiveSupport::Cache::DbStore
- Inherits:
-
Store
- Object
- Store
- ActiveSupport::Cache::DbStore
- Defined in:
- lib/active_support/cache/db_store.rb
Instance Attribute Summary collapse
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
Instance Method Summary collapse
- #cleanup(options = {}) ⇒ Object
- #clear(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ DbStore
constructor
A new instance of DbStore.
Constructor Details
Instance Attribute Details
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
7 8 9 |
# File 'lib/active_support/cache/db_store.rb', line 7 def repository @repository end |
Instance Method Details
#cleanup(options = {}) ⇒ Object
18 19 20 |
# File 'lib/active_support/cache/db_store.rb', line 18 def cleanup( = {}) @repository.where.not(expired_at: nil).update_all(deleted_at: Time.now) end |
#clear(options = {}) ⇒ Object
14 15 16 |
# File 'lib/active_support/cache/db_store.rb', line 14 def clear( = {}) @repository.update_all(deleted_at: Time.now) end |