1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/lib/arel/nodes/grouping.rb
2010-09-15 09:26:01 -07:00

21 lines
542 B
Ruby

module Arel
module Nodes
class Grouping < Arel::Nodes::Node
attr_accessor :expr
def initialize expression
@expr = expression
end
# FIXME: this method should go away. I don't like people calling
# to_sql on non-head nodes. This forces us to walk the AST until we
# can find a node that has a "relation" member.
#
# Maybe we should just use `Table.engine`? :'(
def to_sql
viz = Visitors::ToSql.new Table.engine
viz.accept self
end
end
end
end