Permalink
Browse files

Merge pull request #11598 from Karunakar/flat_map1

Used flat_map instead of map.flatten in mas_many_through_associations_test.rb
  • Loading branch information...
2 parents ca3074c + 8998441 commit af29af674ef5a20b17ed9615323aaaf14ed6384f @rafaelfranca rafaelfranca committed Jul 25, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -647,7 +647,7 @@ def test_has_many_association_through_a_has_many_association_to_self
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

0 comments on commit af29af6

Please sign in to comment.