blob: 3cd9583e79160b3bfb10b895bda034720d81d09a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
module Arel
module Nodes
class Binary
attr_accessor :left, :right
def initialize left, right
@left = left
@right = right
end
def or right
Nodes::Or.new self, right
end
def and right
Nodes::And.new self, right
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
|