aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/mysql/connection_test.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-01-27 13:42:02 -0700
committerSean Griffin <sean@thoughtbot.com>2015-01-27 16:10:03 -0700
commitb06f64c3480cd389d14618540d62da4978918af0 (patch)
tree626a163d2885fd3b91e58c6bcbf60ec3824a51f0 /activerecord/test/cases/adapters/mysql/connection_test.rb
parentd66ffb656e0cfbb4216f030c8e0669509567e362 (diff)
downloadrails-b06f64c3480cd389d14618540d62da4978918af0.tar.gz
rails-b06f64c3480cd389d14618540d62da4978918af0.tar.bz2
rails-b06f64c3480cd389d14618540d62da4978918af0.zip
Remove Relation#bind_params
`bound_attributes` is now used universally across the board, removing the need for the conversion layer. These changes are mostly mechanical, with the exception of the log subscriber. Additional, we had to implement `hash` on the attribute objects, so they could be used as a key for query caching.
Diffstat (limited to 'activerecord/test/cases/adapters/mysql/connection_test.rb')
-rw-r--r--activerecord/test/cases/adapters/mysql/connection_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/adapters/mysql/connection_test.rb b/activerecord/test/cases/adapters/mysql/connection_test.rb
index ce01b16362..4762ef43b5 100644
--- a/activerecord/test/cases/adapters/mysql/connection_test.rb
+++ b/activerecord/test/cases/adapters/mysql/connection_test.rb
@@ -94,7 +94,7 @@ class MysqlConnectionTest < ActiveRecord::TestCase
with_example_table do
@connection.exec_query('INSERT INTO ex (id, data) VALUES (1, "foo")')
result = @connection.exec_query(
- 'SELECT id, data FROM ex WHERE id = ?', nil, [[nil, 1]])
+ 'SELECT id, data FROM ex WHERE id = ?', nil, [ActiveRecord::Relation::QueryAttribute.new("id", 1, ActiveRecord::Type::Value.new)])
assert_equal 1, result.rows.length
assert_equal 2, result.columns.length
@@ -106,10 +106,10 @@ class MysqlConnectionTest < ActiveRecord::TestCase
def test_exec_typecasts_bind_vals
with_example_table do
@connection.exec_query('INSERT INTO ex (id, data) VALUES (1, "foo")')
- column = @connection.columns('ex').find { |col| col.name == 'id' }
+ bind = ActiveRecord::Relation::QueryAttribute.new("id", "1-fuu", ActiveRecord::Type::Integer.new)
result = @connection.exec_query(
- 'SELECT id, data FROM ex WHERE id = ?', nil, [[column, '1-fuu']])
+ 'SELECT id, data FROM ex WHERE id = ?', nil, [bind])
assert_equal 1, result.rows.length
assert_equal 2, result.columns.length