From c6bfd6802ae4c8e179e875a707ec42bf73d13a20 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 15 May 2010 17:43:35 -0300 Subject: When use where more than once on the same column, relation doesn't do an 'or' or 'in' with the values --- activerecord/test/cases/relations_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'activerecord') diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index e39b1f396c..6649923421 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -451,6 +451,15 @@ class RelationTest < ActiveRecord::TestCase assert_equal author, authors end + def test_find_all_using_where_twice_should_or_the_relation + david = authors(:david) + relation = Author.unscoped + relation = relation.where(:name => david.name) + relation = relation.where(:name => 'Santiago') + relation = relation.where(:id => david.id) + assert_equal [david], relation.all + end + def test_exists davids = Author.where(:name => 'David') assert davids.exists? -- cgit v1.2.3