diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 9901f09f57..649fe79fd3 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -699,5 +699,11 @@ class RelationTest < ActiveRecord::TestCase assert_equal 'zyke', car.name end + def test_intersection_with_array + relation = Author.where(:name => "David") + rails_author = relation.first + assert_equal [rails_author], [rails_author] & relation + assert_equal [rails_author], relation & [rails_author] + end end