Skip to content
Browse files

Merge branch 'master' into set_binds

* master:
  rm dup code

Conflicts:
	activerecord/test/cases/relations_test.rb
  • Loading branch information...
2 parents 07a9f47 + 8d146c8 commit 438fce75af61e566cf63da9dbd5593e118a9e4c5 @tenderlove tenderlove committed
Showing with 2 additions and 15 deletions.
  1. +2 −2 activerecord/test/cases/relation/merging_test.rb
  2. +0 −13 activerecord/test/cases/relations_test.rb
View
4 activerecord/test/cases/relation/merging_test.rb
@@ -81,10 +81,10 @@ def test_relation_merging_with_association
left = Post.where(title: "omg").where(comments_count: 1)
right = Post.where(title: "wtf").where(title: "bbq")
- expected = [left.where_values[1]] + right.where_values
+ expected = [left.bind_values[1]] + right.bind_values
merged = left.merge(right)
- assert_equal expected, merged.where_values
+ assert_equal expected, merged.bind_values
assert !merged.to_sql.include?("omg")
assert merged.to_sql.include?("wtf")
assert merged.to_sql.include?("bbq")
View
13 activerecord/test/cases/relations_test.rb
@@ -1511,19 +1511,6 @@ def test_presence
assert !Post.all.respond_to?(:by_lifo)
end
- test "merge collapses wheres from the LHS only" do
- left = Post.where(title: "omg").where(comments_count: 1)
- right = Post.where(title: "wtf").where(title: "bbq")
-
- expected = [left.bind_values[1]] + right.bind_values
- merged = left.merge(right)
-
- assert_equal expected, merged.bind_values
- assert !merged.to_sql.include?("omg")
- assert merged.to_sql.include?("wtf")
- assert merged.to_sql.include?("bbq")
- end
-
def test_unscope_removes_binds
left = Post.where(id: Arel::Nodes::BindParam.new('?'))
column = Post.columns_hash['id']

0 comments on commit 438fce7

Please sign in to comment.
Something went wrong with that request. Please try again.