aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/has_many_through_associations_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2010-11-17 11:32:31 +0000
committerJon Leighton <j@jonathanleighton.com>2010-11-17 11:32:31 +0000
commit1bc90044b655572a4b8aa3b323905e26d37e0f2b (patch)
tree84a2d67b24e149b703308c892d1ec37a1019103b /activerecord/test/cases/associations/has_many_through_associations_test.rb
parente05162cffad7ae86615c21c6b54ab161d0261c39 (diff)
parent401c1835afb5af1a6f429061ac8484227c34909d (diff)
downloadrails-1bc90044b655572a4b8aa3b323905e26d37e0f2b.tar.gz
rails-1bc90044b655572a4b8aa3b323905e26d37e0f2b.tar.bz2
rails-1bc90044b655572a4b8aa3b323905e26d37e0f2b.zip
Merge branch 'master' into nested_has_many_through
Conflicts: activerecord/lib/active_record/associations/has_many_through_association.rb activerecord/test/cases/associations/has_many_through_associations_test.rb
Diffstat (limited to 'activerecord/test/cases/associations/has_many_through_associations_test.rb')
-rw-r--r--activerecord/test/cases/associations/has_many_through_associations_test.rb7
1 files changed, 7 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 4e398751d2..7c3d20e8bd 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -472,4 +472,11 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
authors = Author.joins(:essay_categories_2).where('categories.id' => categories(:general).id)
assert_equal authors(:david), authors.first
end
+
+ def test_size_of_through_association_should_increase_correctly_when_has_many_association_is_added
+ post = posts(:thinking)
+ readers = post.readers.size
+ post.people << people(:michael)
+ assert_equal readers + 1, post.readers.size
+ end
end