instance method
log
Ruby on Rails 4.2.9
Since v2.2.3Signature
log(sql, name = "SQL", binds = [], statement_name = nil)
No documentation comment.
Parameters
-
sqlreq -
nameopt = "SQL" -
bindsopt = [] -
statement_nameopt = nil
Source
# File activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 477
def log(sql, name = "SQL", binds = [], statement_name = nil)
@instrumenter.instrument(
"sql.active_record",
:sql => sql,
:name => name,
:connection_id => object_id,
:statement_name => statement_name,
:binds => binds) { yield }
rescue => e
raise translate_exception_class(e, sql)
end
Defined in activerecord/lib/active_record/connection_adapters/abstract_adapter.rb line 477
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::AbstractAdapter