diff options
Diffstat (limited to 'activerecord/test/cases/explain_test.rb')
-rw-r--r-- | activerecord/test/cases/explain_test.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/test/cases/explain_test.rb b/activerecord/test/cases/explain_test.rb index 4f6bd9327c..17654027a9 100644 --- a/activerecord/test/cases/explain_test.rb +++ b/activerecord/test/cases/explain_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cases/helper" require "models/car" require "active_support/core_ext/string/strip" @@ -47,7 +49,7 @@ if ActiveRecord::Base.connection.supports_explain? def test_exec_explain_with_binds sqls = %w(foo bar) - binds = [[bind_attribute("wadus", 1)], [bind_attribute("chaflan", 2)]] + binds = [[bind_param("wadus", 1)], [bind_param("chaflan", 2)]] queries = sqls.zip(binds) stub_explain_for_query_plans(["query plan foo\n", "query plan bar\n"]) do @@ -79,5 +81,9 @@ if ActiveRecord::Base.connection.supports_explain? yield end end + + def bind_param(name, value) + ActiveRecord::Relation::QueryAttribute.new(name, value, ActiveRecord::Type::Value.new) + end end end |