diff options
Diffstat (limited to 'activerecord/test/cases/relations_test.rb')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 0cf44388fa..7886d9e504 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -848,6 +848,16 @@ class RelationTest < ActiveRecord::TestCase } end + def test_find_all_using_where_with_a_set + david = authors(:david) + mary = authors(:mary) + set = Set.new([david.id, mary.id]) + + assert_queries(1) { + assert_equal [david, mary], Author.where(id: set).to_a + } + end + def test_exists davids = Author.where(:name => 'David') assert davids.exists? |