Class: Arproxy::QueryCallerLocationAnnotator::Proxy

Inherits:
Base
  • Object
show all
Defined in:
lib/arproxy/query_caller_location_annotator/proxy.rb

Instance Method Summary collapse

Instance Method Details

#execute(sql, name = nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/arproxy/query_caller_location_annotator/proxy.rb', line 6

def execute(sql, name=nil)
  return super(sql, name) unless sql =~ /^(SELECT|INSERT|UPDATE|DELETE)/

  location = query_caller_location
  if location.present?
    super("#{sql} /* #{location} */", name)
  else
    super(sql, name)
  end
end