diff options
| author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-01-14 11:56:05 -0800 |
|---|---|---|
| committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-01-14 11:56:05 -0800 |
| commit | b5f679b51ad3d8bdc249d231752c83ddc4d83ac8 (patch) | |
| tree | f05b93e6aeb7610db90d5373664f6fb4ae77978e | |
| parent | c65cfd7648349e3a41206b6e821b3412d4d3ccd8 (diff) | |
| download | rails-b5f679b51ad3d8bdc249d231752c83ddc4d83ac8.tar.gz rails-b5f679b51ad3d8bdc249d231752c83ddc4d83ac8.tar.bz2 rails-b5f679b51ad3d8bdc249d231752c83ddc4d83ac8.zip | |
`where` makes bind values, so stop manually creating them
| -rw-r--r-- | activerecord/test/cases/relations_test.rb | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 06f7a61a6c..db99a22f6a 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -1553,17 +1553,9 @@ class RelationTest < 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: post.id) + left = Post.where(title: post.title) merged = left.merge(right) assert_equal post, merged.first |
