diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-06 10:23:16 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-06 10:23:16 -0700 |
commit | 21267d3c59457141e6dd6e47ba290df2cd583866 (patch) | |
tree | d58ae0744fc9d0dabebbae6265dcf2b9067bd7f8 /lib/arel/algebra | |
parent | 71e0cf6d062f58f3349be53a7ac8421e2c3f488f (diff) | |
download | rails-21267d3c59457141e6dd6e47ba290df2cd583866.tar.gz rails-21267d3c59457141e6dd6e47ba290df2cd583866.tar.bz2 rails-21267d3c59457141e6dd6e47ba290df2cd583866.zip |
inject([]) is a fancy map!
Diffstat (limited to 'lib/arel/algebra')
-rw-r--r-- | lib/arel/algebra/relations/row.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/arel/algebra/relations/row.rb b/lib/arel/algebra/relations/row.rb index f303dcd8d1..84f19e372f 100644 --- a/lib/arel/algebra/relations/row.rb +++ b/lib/arel/algebra/relations/row.rb @@ -12,10 +12,9 @@ module Arel end def slice(*attributes) - Row.new(relation, attributes.inject([]) do |cheese, attribute| + Row.new(relation, attributes.map do |attribute| # FIXME TESTME method chaining - cheese << tuple[relation.relation.position_of(attribute)] - cheese + tuple[relation.relation.position_of(attribute)] end) end |