diff options
Diffstat (limited to 'activerecord/test/associations')
-rw-r--r-- | activerecord/test/associations/eager_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/associations/eager_test.rb b/activerecord/test/associations/eager_test.rb index bbf3edd0c9..fa632bdf69 100644 --- a/activerecord/test/associations/eager_test.rb +++ b/activerecord/test/associations/eager_test.rb @@ -103,6 +103,11 @@ class EagerAssociationTest < Test::Unit::TestCase assert_equal [2], posts.collect { |p| p.id } end + def test_eager_association_loading_with_explicit_join + posts = Post.find(:all, :include => :comments, :joins => "INNER JOIN authors ON posts.author_id = authors.id AND authors.name = 'Mary'", :limit => 1, :order => 'author_id') + assert_equal 1, posts.length + end + def test_eager_with_has_many_through posts_with_comments = people(:michael).posts.find(:all, :include => :comments) posts_with_author = people(:michael).posts.find(:all, :include => :author ) |