Permalink
Browse files

used flat_map instead of map.flatten

  • Loading branch information...
1 parent ca3074c commit 8998441967a8cfc6e4302c29664ab9d0acd77704 @Karunakar Karunakar 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 8998441

Please sign in to comment.