From 7fc3ca5fadecd4c6c506078281f556c28a5c382d Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 2 Aug 2013 15:29:47 -0700 Subject: [PATCH] add a test for concat on hm:t associations --- .../associations/has_many_through_associations_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) 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 85296a5a83..724d1cbbf8 100644 --- a/activerecord/test/cases/associations/has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb @@ -91,6 +91,13 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase end end + def test_concat + person = people(:david) + post = posts(:thinking) + post.people.concat [person] + assert_equal 1, post.people.size + assert_equal 1, post.people(true).size + end def test_associate_existing_record_twice_should_add_to_target_twice post = posts(:thinking)