aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/has_many_through_associations_test.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-02-06 19:44:24 +0900
committerGitHub <noreply@github.com>2019-02-06 19:44:24 +0900
commit9cc463ed7b7be098602b72a98f72220ea6466ba2 (patch)
tree311386802febb8bd8ecac4e90a93f0e5dfbfa3be /activerecord/test/cases/associations/has_many_through_associations_test.rb
parentdaa264fb5afc353cb044787993b9d9b98f774b26 (diff)
parent788eb51df3007d94b266965433b0be88a23b84c5 (diff)
downloadrails-9cc463ed7b7be098602b72a98f72220ea6466ba2.tar.gz
rails-9cc463ed7b7be098602b72a98f72220ea6466ba2.tar.bz2
rails-9cc463ed7b7be098602b72a98f72220ea6466ba2.zip
Merge pull request #35174 from ypresto/fix-concat-retval
Fix `CollectionProxy#concat` to return self by alias it to `#<<`
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.rb3
1 files changed, 2 insertions, 1 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 0133beccec..0ac56c6168 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -242,9 +242,10 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
def test_concat
person = people(:david)
post = posts(:thinking)
- post.people.concat [person]
+ result = post.people.concat [person]
assert_equal 1, post.people.size
assert_equal 1, post.people.reload.size
+ assert_equal post.people, result
end
def test_associate_existing_record_twice_should_add_to_target_twice