Class: ActiveRecord::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/patches/db/oracle_enhanced.rb

Instance Method Summary collapse

Instance Method Details

#each(&blk) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/patches/db/oracle_enhanced.rb', line 5

def each(&blk)
  return each_without_profiling(&blk) unless defined?(@miniprofiler_sql_id)

  start        = Process.clock_gettime(Process::CLOCK_MONOTONIC)
  result       = each_without_profiling(&blk)
  elapsed_time = SqlPatches.elapsed_time(start)
  @miniprofiler_sql_id.report_reader_duration(elapsed_time)

  result
end

#each_without_profilingObject



4
# File 'lib/patches/db/oracle_enhanced.rb', line 4

alias_method :each_without_profiling, :each