diff options
Diffstat (limited to 'lib/arel/nodes/select_core.rb')
-rw-r--r-- | lib/arel/nodes/select_core.rb | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/arel/nodes/select_core.rb b/lib/arel/nodes/select_core.rb index 501a2aaf7c..7f577e0a05 100644 --- a/lib/arel/nodes/select_core.rb +++ b/lib/arel/nodes/select_core.rb @@ -1,24 +1,35 @@ module Arel module Nodes class SelectCore < Arel::Nodes::Node - attr_accessor :top, :froms, :projections, :wheres, :groups - attr_accessor :having + attr_accessor :top, :projections, :wheres, :groups + attr_accessor :having, :source def initialize + @source = JoinSource.new nil @top = nil - @froms = nil @projections = [] @wheres = [] @groups = [] @having = nil end + def from + @source.left + end + + def from= value + @source.left = value + end + + alias :froms= :from= + alias :froms :from + def initialize_copy other super - @froms = @froms.clone if @froms + @source = @source.clone if @source @projections = @projections.clone @wheres = @wheres.clone - @group = @groups.clone + @groups = @groups.clone @having = @having.clone if @having end end |