Module: SecondLevelCache
- Defined in:
- lib/second_level_cache.rb,
lib/second_level_cache/mixin.rb,
lib/second_level_cache/config.rb,
lib/second_level_cache/version.rb,
lib/second_level_cache/record_relation.rb,
lib/second_level_cache/active_record/base.rb,
lib/second_level_cache/active_record/core.rb,
lib/second_level_cache/active_record/preloader.rb,
lib/second_level_cache/active_record/persistence.rb,
lib/second_level_cache/active_record/finder_methods.rb,
lib/second_level_cache/active_record/fetch_by_uniq_key.rb,
lib/second_level_cache/active_record/has_one_association.rb,
lib/second_level_cache/active_record/belongs_to_association.rb
Defined Under Namespace
Modules: ActiveRecord, Mixin
Classes: Config, RecordRelation
Constant Summary
collapse
- VERSION =
"2.5.2"
Class Method Summary
collapse
Class Method Details
.cache_enabled=(cache_enabled) ⇒ Object
28
29
30
|
# File 'lib/second_level_cache.rb', line 28
def self.cache_enabled=(cache_enabled)
Thread.current[:slc_cache_enabled] = cache_enabled
end
|
.cache_enabled? ⇒ Boolean
23
24
25
26
|
# File 'lib/second_level_cache.rb', line 23
def self.cache_enabled?
cache_enabled = Thread.current[:slc_cache_enabled]
cache_enabled.nil? ? true : cache_enabled
end
|
10
11
12
|
# File 'lib/second_level_cache.rb', line 10
def self.configure
block_given? ? yield(Config) : Config
end
|
.without_second_level_cache ⇒ Object