aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorTarmo Tänav <tarmo@itech.ee>2008-08-26 19:00:47 +0300
committerJeremy Kemper <jeremy@bitsweat.net>2008-08-27 23:29:29 -0700
commit13671cc565aad2327f81a29789154b829ceeda04 (patch)
tree9fcca45f5d322423f71563f91b11dbfa84f01c92 /activerecord/test
parentad562c58eabfb8b44cb8ac9e87b87a7f998325fd (diff)
downloadrails-13671cc565aad2327f81a29789154b829ceeda04.tar.gz
rails-13671cc565aad2327f81a29789154b829ceeda04.tar.bz2
rails-13671cc565aad2327f81a29789154b829ceeda04.zip
Alias included associations if needed when doing a count
[#302 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations/has_many_through_associations_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb
index d51a3c7e1c..353262c81b 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -196,4 +196,8 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
# due to Unknown column 'comments.id'
assert Person.find(1).posts_with_comments_sorted_by_comment_id.find_by_title('Welcome to the weblog')
end
+
+ def test_count_with_include_should_alias_join_table
+ assert_equal 2, people(:michael).posts.count(:include => :readers)
+ end
end