Module: ActiveRecord::RuntimeRegistry
- Defined in:
- lib/time_bandits/monkey_patches/active_record/runtime_registry.rb
Class Method Summary collapse
- .call_count ⇒ Object
- .call_count=(value) ⇒ Object
- .query_cache_hits ⇒ Object
- .query_cache_hits=(value) ⇒ Object
- .reset_call_count ⇒ Object
- .reset_query_cache_hits ⇒ Object
Class Method Details
.call_count ⇒ Object
10 11 12 |
# File 'lib/time_bandits/monkey_patches/active_record/runtime_registry.rb', line 10 def self.call_count ActiveSupport::IsolatedExecutionState[:active_record_sql_call_count] ||= 0 end |
.call_count=(value) ⇒ Object
14 15 16 |
# File 'lib/time_bandits/monkey_patches/active_record/runtime_registry.rb', line 14 def self.call_count=(value) ActiveSupport::IsolatedExecutionState[:active_record_sql_call_count] = value end |
.query_cache_hits ⇒ Object
18 19 20 |
# File 'lib/time_bandits/monkey_patches/active_record/runtime_registry.rb', line 18 def self.query_cache_hits ActiveSupport::IsolatedExecutionState[:active_record_sql_query_cache_hits] ||= 0 end |
.query_cache_hits=(value) ⇒ Object
22 23 24 |
# File 'lib/time_bandits/monkey_patches/active_record/runtime_registry.rb', line 22 def self.query_cache_hits=(value) ActiveSupport::IsolatedExecutionState[:active_record_sql_query_cache_hits] = value end |
.reset_call_count ⇒ Object
30 31 32 33 34 |
# File 'lib/time_bandits/monkey_patches/active_record/runtime_registry.rb', line 30 def self.reset_call_count calls = call_count self.call_count = 0 calls end |
.reset_query_cache_hits ⇒ Object
36 37 38 39 40 |
# File 'lib/time_bandits/monkey_patches/active_record/runtime_registry.rb', line 36 def self.reset_query_cache_hits hits = query_cache_hits self.query_cache_hits = 0 hits end |