Class: ActiveRecord::ConnectionAdapters::AbstractAdapter
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::AbstractAdapter
- Defined in:
- lib/time_bandits/monkey_patches/active_record_rails2.rb
Instance Attribute Summary collapse
-
#call_count ⇒ Object
Returns the value of attribute call_count.
-
#query_cache_hits ⇒ Object
Returns the value of attribute query_cache_hits.
Instance Method Summary collapse
-
#initialize(connection, logger = nil) ⇒ AbstractAdapter
constructor
:nodoc:.
- #reset_call_count ⇒ Object
- #reset_query_cache_hits ⇒ Object
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_count ⇒ Object
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_hits ⇒ Object
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_count ⇒ Object
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_hits ⇒ Object
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 |