diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2014-03-09 10:04:57 +0000 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2014-03-09 10:04:57 +0000 |
commit | ec23277124b2f602bed1772926e687556de15176 (patch) | |
tree | f30c895b87e4c43ddb970011d25a22d3fb708667 /activerecord/lib/active_record/associations.rb | |
parent | 45efd0ebf77811e43cebc68400c24652133a0f99 (diff) | |
parent | cff340f1eda96be952437abeed80591a85ef0194 (diff) | |
download | rails-ec23277124b2f602bed1772926e687556de15176.tar.gz rails-ec23277124b2f602bed1772926e687556de15176.tar.bz2 rails-ec23277124b2f602bed1772926e687556de15176.zip |
Merge pull request #14262 from sferik/flat_map
Replace additional instances of map.flatten with flat_map
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rw-r--r-- | activerecord/lib/active_record/associations.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 53f7591226..f725356cd9 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -530,8 +530,8 @@ module ActiveRecord # end # # @firm = Firm.first - # @firm.clients.collect { |c| c.invoices }.flatten # select all invoices for all clients of the firm - # @firm.invoices # selects all invoices by going through the Client join model + # @firm.clients.flat_map { |c| c.invoices } # select all invoices for all clients of the firm + # @firm.invoices # selects all invoices by going through the Client join model # # Similarly you can go through a +has_one+ association on the join model: # |