Skip to content

Commit a59e2cd

Browse files
byrootjoelhawksley
authored andcommitted
Revert "Get rid of unused AbstractAdapter#log method"
This reverts commit a56fbfa.
1 parent 5fa27d9 commit a59e2cd

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

activerecord/lib/active_record/connection_adapters/abstract_adapter.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,23 @@ def translate_exception_class(native_error, sql, binds)
11181118
active_record_error
11191119
end
11201120

1121+
def log(sql, name = "SQL", binds = [], type_casted_binds = [], async: false, &block) # :doc:
1122+
@instrumenter.instrument(
1123+
"sql.active_record",
1124+
sql: sql,
1125+
name: name,
1126+
binds: binds,
1127+
type_casted_binds: type_casted_binds,
1128+
async: async,
1129+
connection: self,
1130+
transaction: current_transaction.user_transaction.presence,
1131+
row_count: 0,
1132+
&block
1133+
)
1134+
rescue ActiveRecord::StatementInvalid => ex
1135+
raise ex.set_query(sql, binds)
1136+
end
1137+
11211138
def translate_exception(exception, message:, sql:, binds:)
11221139
# override in derived class
11231140
case exception

0 commit comments

Comments
 (0)