aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-08-06 10:23:16 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-08-06 10:23:16 -0700
commit21267d3c59457141e6dd6e47ba290df2cd583866 (patch)
treed58ae0744fc9d0dabebbae6265dcf2b9067bd7f8
parent71e0cf6d062f58f3349be53a7ac8421e2c3f488f (diff)
downloadrails-21267d3c59457141e6dd6e47ba290df2cd583866.tar.gz
rails-21267d3c59457141e6dd6e47ba290df2cd583866.tar.bz2
rails-21267d3c59457141e6dd6e47ba290df2cd583866.zip
inject([]) is a fancy map!
-rw-r--r--lib/arel/algebra/relations/row.rb5
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