Class: Mysql2::Result

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

Instance Method Summary collapse

Instance Method Details

#each(*args, &blk) ⇒ Object



23
24
25
26
27
28
29
30
31
32
# File 'lib/patches/sql_patches.rb', line 23

def each(*args, &blk)
  return each_without_profiling(*args, &blk) unless @miniprofiler_sql_id

  start = Time.now
  result = each_without_profiling(*args,&blk) 
  elapsed_time = ((Time.now - start).to_f * 1000).round(1)

  @miniprofiler_sql_id.report_reader_duration(elapsed_time) 
  result
end

#each_without_profilingObject



22
# File 'lib/patches/sql_patches.rb', line 22

alias_method :each_without_profiling, :each