2010-08-12 19:19:54 -04:00
|
|
|
module Arel
|
|
|
|
module Nodes
|
2010-11-29 18:23:58 -05:00
|
|
|
class SelectCore < Arel::Nodes::Node
|
2010-12-14 12:43:19 -05:00
|
|
|
attr_accessor :projections, :wheres, :groups
|
|
|
|
attr_accessor :having, :source
|
2010-12-07 17:20:30 -05:00
|
|
|
|
2010-08-12 19:19:54 -04:00
|
|
|
def initialize
|
2010-12-14 12:43:19 -05:00
|
|
|
@source = JoinSource.new nil
|
2010-08-12 19:19:54 -04:00
|
|
|
@projections = []
|
|
|
|
@wheres = []
|
2010-09-07 18:47:38 -04:00
|
|
|
@groups = []
|
2010-09-08 18:29:22 -04:00
|
|
|
@having = nil
|
2010-08-12 19:19:54 -04:00
|
|
|
end
|
2010-08-19 01:30:36 -04:00
|
|
|
|
2010-12-14 12:43:19 -05:00
|
|
|
def from
|
|
|
|
@source.left
|
|
|
|
end
|
|
|
|
|
|
|
|
def from= value
|
|
|
|
@source.left = value
|
|
|
|
end
|
|
|
|
|
|
|
|
alias :froms= :from=
|
|
|
|
alias :froms :from
|
|
|
|
|
2010-08-19 01:30:36 -04:00
|
|
|
def initialize_copy other
|
|
|
|
super
|
2010-12-14 12:43:19 -05:00
|
|
|
@source = @source.clone if @source
|
2010-08-30 18:35:13 -04:00
|
|
|
@projections = @projections.clone
|
2010-09-07 18:47:38 -04:00
|
|
|
@wheres = @wheres.clone
|
|
|
|
@group = @groups.clone
|
2010-09-08 18:29:22 -04:00
|
|
|
@having = @having.clone if @having
|
2010-08-19 01:30:36 -04:00
|
|
|
end
|
2010-08-12 19:19:54 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|