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
15 16 17 |
# File 'lib/time_bandits/monkey_patches/active_record/runtime_registry.rb', line 15 def self.call_count ActiveSupport::IsolatedExecutionState[:active_record_sql_call_count] ||= 0 end |
.call_count=(value) ⇒ Object
19 20 21 |
# File 'lib/time_bandits/monkey_patches/active_record/runtime_registry.rb', line 19 def self.call_count=(value) ActiveSupport::IsolatedExecutionState[:active_record_sql_call_count] = value end |
.query_cache_hits ⇒ Object
28 29 30 |
# File 'lib/time_bandits/monkey_patches/active_record/runtime_registry.rb', line 28 def self.query_cache_hits ActiveSupport::IsolatedExecutionState[:active_record_sql_query_cache_hits] ||= 0 end |
.query_cache_hits=(value) ⇒ Object
32 33 34 |
# File 'lib/time_bandits/monkey_patches/active_record/runtime_registry.rb', line 32 def self.query_cache_hits=(value) ActiveSupport::IsolatedExecutionState[:active_record_sql_query_cache_hits] = value end |
.reset_call_count ⇒ Object
45 46 47 48 49 |
# File 'lib/time_bandits/monkey_patches/active_record/runtime_registry.rb', line 45 def self.reset_call_count calls = call_count self.call_count = 0 calls end |
.reset_query_cache_hits ⇒ Object
51 52 53 54 55 |
# File 'lib/time_bandits/monkey_patches/active_record/runtime_registry.rb', line 51 def self.reset_query_cache_hits hits = query_cache_hits self.query_cache_hits = 0 hits end |