diff options
author | David Wilkins <dwilkins@gitlab.com> | 2019-08-28 12:37:05 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-08-28 12:37:05 +0300 |
commit | 0cdd69ed5f78cd47d39e8af51f3a3c233f15dce6 (patch) | |
tree | 5f0e8ad924690b5191569f1f9f6fa8f1a973d9ad /spec/support/helpers | |
parent | f90759bbf31853e0e69db98588f2416cdef6e2f6 (diff) |
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
Diffstat (limited to 'spec/support/helpers')
-rw-r--r-- | spec/support/helpers/query_recorder.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/support/helpers/query_recorder.rb b/spec/support/helpers/query_recorder.rb index d936dc6de41..9d47a0c23df 100644 --- a/spec/support/helpers/query_recorder.rb +++ b/spec/support/helpers/query_recorder.rb @@ -8,7 +8,10 @@ module ActiveRecord @log = [] @cached = [] @skip_cached = skip_cached - ActiveSupport::Notifications.subscribed(method(:callback), 'sql.active_record', &block) + # 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) |