Permalink
Browse files

where uses bind values so we don't need to manually create them

  • Loading branch information...
1 parent f4d6008 commit 25bc0fbf513af08bb46c77739b91b63edb318f0a @tenderlove tenderlove committed Jan 14, 2014
Showing with 3 additions and 11 deletions.
  1. +3 −11 activerecord/test/cases/relation/merging_test.rb
@@ -102,17 +102,9 @@ def test_merging_keeps_lhs_bind_parameters
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

0 comments on commit 25bc0fb

Please sign in to comment.