19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/new_relic/agent/instrumentation/active_record_notifications.rb', line 19
def log(sql, name = 'SQL', binds = [], statement_name = nil)
@instrumenter.instrument(
SQL_ACTIVE_RECORD,
:sql => sql,
:name => name,
:connection_id => object_id,
:connection => self,
:statement_name => statement_name,
:binds => binds
) { yield }
rescue => e
if ::ActiveRecord::VERSION::MINOR == 0
raise translate_exception(e, sql)
else
raise translate_exception_class(e, sql)
end
end
|