diff options
Diffstat (limited to 'lib/arel')
-rw-r--r-- | lib/arel/algebra/relations/operations/project.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/arel/algebra/relations/operations/project.rb b/lib/arel/algebra/relations/operations/project.rb index b78d5d3e97..17431c9a82 100644 --- a/lib/arel/algebra/relations/operations/project.rb +++ b/lib/arel/algebra/relations/operations/project.rb @@ -1,15 +1,11 @@ module Arel class Project < Compound - attr_reader :projections + attr_reader :projections, :attributes def initialize(relation, *projections) super(relation) @projections = projections.collect { |p| p.bind(relation) } - @attributes = nil - end - - def attributes - @attributes ||= Header.new(projections).bind(self) + @attributes = Header.new(projections.map { |x| x.bind(self) }) end def externalizable? |