Module: ActiveRecord::RuntimeRegistry

Defined in:
lib/time_bandits/monkey_patches/active_record/runtime_registry.rb

Class Method Summary collapse

Class Method Details

.call_countObject



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_hitsObject



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_countObject



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_hitsObject



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