summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Wilkins <dwilkins@gitlab.com>2019-08-28 09:37:05 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2019-08-28 09:37:05 +0000
commit0cdd69ed5f78cd47d39e8af51f3a3c233f15dce6 (patch)
tree5f0e8ad924690b5191569f1f9f6fa8f1a973d9ad
parentf90759bbf31853e0e69db98588f2416cdef6e2f6 (diff)
downloadgitlab-ce-0cdd69ed5f78cd47d39e8af51f3a3c233f15dce6.tar.gz
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
-rw-r--r--spec/support/helpers/query_recorder.rb5
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)