From 089b56e46ea550557c61d32f3cdcae567bede4b7 Mon Sep 17 00:00:00 2001 From: Jeremy Olliver Date: Tue, 15 Jun 2010 21:54:19 +1200 Subject: [PATCH] Test AR#count using include with a polymorphic association --- .../test/cases/associations/join_model_test.rb | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/activerecord/test/cases/associations/join_model_test.rb b/activerecord/test/cases/associations/join_model_test.rb index 447fe4d..8255be0 100644 --- a/activerecord/test/cases/associations/join_model_test.rb +++ b/activerecord/test/cases/associations/join_model_test.rb @@ -608,6 +608,10 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase p = Post.find(posts(:welcome).id, :include => {:taggings => :taggable}) assert_no_queries {assert_equal posts(:welcome), p.taggings.first.taggable} end + + def test_polymorphic_include_with_count + assert_nothing_raised { Post.count(:include => [:taggings]) } + end def test_preload_polymorphic_has_many_through posts = Post.find(:all, :order => 'posts.id') -- 1.6.6