Class: ActiveRecord::ConnectionAdapters::AbstractAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/time_bandits/monkey_patches/active_record_rails2.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, logger = nil) ⇒ AbstractAdapter

:nodoc:



18
19
20
21
22
23
24
25
# File 'lib/time_bandits/monkey_patches/active_record_rails2.rb', line 18

def initialize(connection, logger = nil) #:nodoc:
  @connection, @logger = connection, logger
  @runtime = 0
  @call_count = 0
  @last_verification = 0
  @query_cache_enabled = false
  @query_cache_hits = 0
end

Instance Attribute Details

#call_countObject

Returns the value of attribute call_count.



16
17
18
# File 'lib/time_bandits/monkey_patches/active_record_rails2.rb', line 16

def call_count
  @call_count
end

#query_cache_hitsObject

Returns the value of attribute query_cache_hits.



16
17
18
# File 'lib/time_bandits/monkey_patches/active_record_rails2.rb', line 16

def query_cache_hits
  @query_cache_hits
end

Instance Method Details

#reset_call_countObject



27
28
29
30
31
# File 'lib/time_bandits/monkey_patches/active_record_rails2.rb', line 27

def reset_call_count
  calls = @call_count
  @call_count = 0
  calls
end

#reset_query_cache_hitsObject



33
34
35
36
37
# File 'lib/time_bandits/monkey_patches/active_record_rails2.rb', line 33

def reset_query_cache_hits
  hits = @query_cache_hits
  @query_cache_hits = 0
  hits
end