Apply bindings to querys from QueryRecorder

- local tests that assume certain parameters to queries from
  QueryRecorder fail. These same tests don't fail in the runners,
  and I can't tell why. This fixes the local failures
This commit is contained in:
David Wilkins 2019-08-28 09:37:05 +00:00 committed by Grzegorz Bizon
parent f90759bbf3
commit 0cdd69ed5f

View file

@ -8,8 +8,11 @@ module ActiveRecord
@log = []
@cached = []
@skip_cached = skip_cached
# force replacement of bind parameters to give tests the ability to check for ids
ActiveRecord::Base.connection.unprepared_statement do
ActiveSupport::Notifications.subscribed(method(:callback), 'sql.active_record', &block)
end
end
def show_backtrace(values)
Rails.logger.debug("QueryRecorder SQL: #{values[:sql]}")