Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Wilkins <dwilkins@gitlab.com>2019-08-28 12:37:05 +0300
committerGrzegorz Bizon <grzegorz@gitlab.com>2019-08-28 12:37:05 +0300
commit0cdd69ed5f78cd47d39e8af51f3a3c233f15dce6 (patch)
tree5f0e8ad924690b5191569f1f9f6fa8f1a973d9ad /spec/support
parentf90759bbf31853e0e69db98588f2416cdef6e2f6 (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')
-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)