diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-18 13:39:21 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-18 13:39:57 -0800 |
commit | e107dcca6b132d39f578b48fba39891eaf902a0d (patch) | |
tree | b28b0e03c6e1ca63f87b5daeeea04f505e1f56fa /activerecord | |
parent | e3d8331c5b543ea7ea2024d05bd79526d11341c0 (diff) | |
download | rails-e107dcca6b132d39f578b48fba39891eaf902a0d.tar.gz rails-e107dcca6b132d39f578b48fba39891eaf902a0d.tar.bz2 rails-e107dcca6b132d39f578b48fba39891eaf902a0d.zip |
testing multiple ORd queries
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 6649923421..535bcd4396 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -460,6 +460,18 @@ class RelationTest < ActiveRecord::TestCase assert_equal [david], relation.all end + def test_find_all_with_multiple_ors + david = authors(:david) + relation = [ + { :name => david.name }, + { :name => 'Santiago' }, + { :name => 'tenderlove' }, + ].inject(Author.unscoped) do |memo, param| + memo.where(param) + end + assert_equal [david], relation.all + end + def test_exists davids = Author.where(:name => 'David') assert davids.exists? |