aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/bind_parameter_test.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2017-07-21 13:55:24 -0400
committerSean Griffin <sean@seantheprogrammer.com>2017-07-21 14:01:08 -0400
commit93c9a95e013ba7c77cf381bab9ead4a0de37e128 (patch)
tree80d9c83c1be59f8227900369673607660d43b0c0 /activerecord/test/cases/bind_parameter_test.rb
parent84eb498f84ebc5d1be0b0db6f7bca9da3d679ca6 (diff)
downloadrails-93c9a95e013ba7c77cf381bab9ead4a0de37e128.tar.gz
rails-93c9a95e013ba7c77cf381bab9ead4a0de37e128.tar.bz2
rails-93c9a95e013ba7c77cf381bab9ead4a0de37e128.zip
Revert "Extract `bind_param` and `bind_attribute` into `ActiveRecord::TestCase`"
This reverts commit b6ad4052d18e4b29b8a092526c2beef013e2bf4f. This is not something that the majority of Active Record should be testing or care about. We should look at having fewer places rely on these details, not make it easier to rely on them.
Diffstat (limited to 'activerecord/test/cases/bind_parameter_test.rb')
-rw-r--r--activerecord/test/cases/bind_parameter_test.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/test/cases/bind_parameter_test.rb b/activerecord/test/cases/bind_parameter_test.rb
index 5af44c27eb..49fe219563 100644
--- a/activerecord/test/cases/bind_parameter_test.rb
+++ b/activerecord/test/cases/bind_parameter_test.rb
@@ -39,8 +39,9 @@ if ActiveRecord::Base.connection.prepared_statements
end
def test_binds_are_logged
- binds = [bind_attribute("id", 1)]
- sql = "select * from topics where id = #{bind_param.to_sql}"
+ sub = Arel::Nodes::BindParam.new
+ binds = [Relation::QueryAttribute.new("id", 1, Type::Value.new)]
+ sql = "select * from topics where id = #{sub.to_sql}"
@connection.exec_query(sql, "SQL", binds)
@@ -55,7 +56,7 @@ if ActiveRecord::Base.connection.prepared_statements
end
def test_logs_binds_after_type_cast
- binds = [bind_attribute("id", "10", Type::Integer.new)]
+ binds = [Relation::QueryAttribute.new("id", "10", Type::Integer.new)]
assert_logs_binds(binds)
end