instance method
log
Ruby on Rails 8.1.2
Since v2.2.3 PrivateSignature
log(sql, name = "SQL", binds = [], type_casted_binds = [], async: false, allow_retry: false, &block)
No documentation comment.
Parameters
-
sqlreq -
nameopt = "SQL" -
bindsopt = [] -
type_casted_bindsopt = [] -
asynckey = false -
allow_retrykey = false -
blockblock
Source
# File activerecord/lib/active_record/connection_adapters/abstract_adapter.rb, line 1205
def log(sql, name = "SQL", binds = [], type_casted_binds = [], async: false, allow_retry: false, &block) # :doc:
instrumenter.instrument(
"sql.active_record",
sql: sql,
name: name,
binds: binds,
type_casted_binds: type_casted_binds,
async: async,
allow_retry: allow_retry,
connection: self,
transaction: current_transaction.user_transaction.presence,
affected_rows: 0,
row_count: 0,
&block
)
rescue ActiveRecord::StatementInvalid => ex
raise ex.set_query(sql, binds)
end
Defined in activerecord/lib/active_record/connection_adapters/abstract_adapter.rb line 1205
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::AbstractAdapter