diff options
author | Arun Agrawal <arunagw@gmail.com> | 2013-10-09 14:38:44 +0200 |
---|---|---|
committer | Arun Agrawal <arunagw@gmail.com> | 2013-10-09 14:38:44 +0200 |
commit | 91fe499275f8a2240e47f0bbb83cfe03aac1285d (patch) | |
tree | 509b33b1020d3801fbd2ea6b318fe0f929a1465c | |
parent | a6bb8f4e3af31668abda791a2b65ca75bf25f4df (diff) | |
download | rails-91fe499275f8a2240e47f0bbb83cfe03aac1285d.tar.gz rails-91fe499275f8a2240e47f0bbb83cfe03aac1285d.tar.bz2 rails-91fe499275f8a2240e47f0bbb83cfe03aac1285d.zip |
Using flat_map instead of map and flatten
original commit 8998441967a8cfc6e4302c29664ab9d0acd77704
Reverted here ec8ef1e1055c4e1598da13f49d30261f07f4a9b4
-rw-r--r-- | activerecord/test/cases/associations/has_many_through_associations_test.rb | 2 |
1 files changed, 1 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 5299e4e17e..3b61b91d62 100644 --- a/activerecord/test/cases/associations/has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb @@ -785,7 +785,7 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase sarah = Person.create!(:first_name => 'Sarah', :primary_contact_id => people(:susan).id, :gender => 'F', :number1_fan_id => 1) john = Person.create!(:first_name => 'John', :primary_contact_id => sarah.id, :gender => 'M', :number1_fan_id => 1) assert_equal sarah.agents, [john] - assert_equal people(:susan).agents.map(&:agents).flatten, people(:susan).agents_of_agents + assert_equal people(:susan).agents.flat_map(&:agents), people(:susan).agents_of_agents end def test_associate_existing_with_nonstandard_primary_key_on_belongs_to |