From 21267d3c59457141e6dd6e47ba290df2cd583866 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 6 Aug 2010 10:23:16 -0700 Subject: inject([]) is a fancy map! --- lib/arel/algebra/relations/row.rb | 5 ++--- 1 file 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 -- cgit v1.2.3