diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-01-14 10:43:53 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-01-14 10:43:53 -0800 |
commit | 25bc0fbf513af08bb46c77739b91b63edb318f0a (patch) | |
tree | f214f05683c08defcc05e82e41ce24f9d625de0e /activerecord/test/cases/relation | |
parent | f4d600865c6bcb170f34d9ba5bfc8ace432fee8b (diff) | |
download | rails-25bc0fbf513af08bb46c77739b91b63edb318f0a.tar.gz rails-25bc0fbf513af08bb46c77739b91b63edb318f0a.tar.bz2 rails-25bc0fbf513af08bb46c77739b91b63edb318f0a.zip |
where uses bind values so we don't need to manually create them
Diffstat (limited to 'activerecord/test/cases/relation')
-rw-r--r-- | activerecord/test/cases/relation/merging_test.rb | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/activerecord/test/cases/relation/merging_test.rb b/activerecord/test/cases/relation/merging_test.rb index 3dc2c0ea11..744fb580b8 100644 --- a/activerecord/test/cases/relation/merging_test.rb +++ b/activerecord/test/cases/relation/merging_test.rb @@ -102,17 +102,9 @@ class RelationMergingTest < ActiveRecord::TestCase end def test_merging_reorders_bind_params - post = Post.first - id_column = Post.columns_hash['id'] - title_column = Post.columns_hash['title'] - - bv = Post.connection.substitute_at id_column, 0 - - right = Post.where(id: bv) - right.bind_values += [[id_column, post.id]] - - left = Post.where(title: bv) - left.bind_values += [[title_column, post.title]] + post = Post.first + right = Post.where(id: 1) + left = Post.where(title: post.title) merged = left.merge(right) assert_equal post, merged.first |