From 042211452e832d30c841f8c6e40d28afd1589f57 Mon Sep 17 00:00:00 2001 From: Ryan Wallace Date: Mon, 13 Sep 2010 11:09:27 -0400 Subject: [PATCH] Add test to demonstrate failure with eager loading hmt where the association has an order. --- activerecord/test/cases/associations/eager_test.rb | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 1870f97..b711719 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -363,7 +363,12 @@ class EagerAssociationTest < ActiveRecord::TestCase assert_equal post_tags, eager_post_tags end - + def test_eager_with_has_many_through_association_with_order + author_comments = Author.find(authors(:david).id).comments_desc + eager_author_comments = Author.find(authors(:david).id, :include => :comments_desc).comments_desc + assert_equal eager_author_comments, author_comments + end + def test_eager_with_has_many_through_join_model_with_include author_comments = Author.find(authors(:david).id, :include => :comments_with_include).comments_with_include.to_a assert_no_queries do -- 1.7.0.2