Class: PG::Result

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

Instance Method Summary collapse

Instance Method Details

#each(*args, &blk) ⇒ Object



80
81
82
83
84
85
86
87
88
89
# File 'lib/patches/sql_patches.rb', line 80

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



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

alias_method :each_without_profiling, :each

#values(*args, &blk) ⇒ Object



69
70
71
72
73
74
75
76
77
78
# File 'lib/patches/sql_patches.rb', line 69

def values(*args, &blk)
  return values_without_profiling(*args, &blk) unless @miniprofiler_sql_id

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

  @miniprofiler_sql_id.report_reader_duration(elapsed_time)
  result
end

#values_without_profilingObject



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

alias_method :values_without_profiling, :values