Module: ActiveRecordQueryCount

Extended by:
Recording::Base
Defined in:
lib/active-record-query-count.rb,
lib/active_record_query_count/version.rb,
lib/active_record_query_count/middleware.rb,
lib/active_record_query_count/printer/base.rb,
lib/active_record_query_count/printer/html.rb,
lib/active_record_query_count/configuration.rb,
lib/active_record_query_count/recording/base.rb,
lib/active_record_query_count/printer/console.rb,
lib/active_record_query_count/recording/tracker.rb,
lib/active_record_query_count/compare/comparator.rb,
lib/active_record_query_count/printer/html_compare.rb

Defined Under Namespace

Modules: Compare, Configuration, Printer, Recording Classes: Middleware, QueryCountRailtie, Tracker

Constant Summary collapse

VERSION =
'0.1.5'

Class Method Summary collapse

Methods included from Recording::Base

end_recording, start_recording, start_with_block

Class Method Details

.compare {|comparator| ... } ⇒ Object

Yields:

  • (comparator)


32
33
34
35
# File 'lib/active-record-query-count.rb', line 32

def compare
  comparator = Compare::Comparator.new
  yield(comparator)
end

.configure {|Configuration| ... } ⇒ Object

Yields:



24
25
26
# File 'lib/active-record-query-count.rb', line 24

def configure
  yield(Configuration)
end

.trackerObject



28
29
30
# File 'lib/active-record-query-count.rb', line 28

def tracker
  Thread.current[:query_counter_data] ||= Tracker.new
end