Skip to content

Commit

Permalink
rm dup code
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Jan 15, 2014
1 parent 3204bbf commit 8d146c8
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions activerecord/test/cases/relations_test.rb
Expand Up @@ -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.where_values[1]] + right.where_values
merged = left.merge(right)

assert_equal expected, merged.where_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']
Expand Down

0 comments on commit 8d146c8

Please sign in to comment.