diff options
Diffstat (limited to 'lib/arel/nodes/node.rb')
-rw-r--r-- | lib/arel/nodes/node.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/arel/nodes/node.rb b/lib/arel/nodes/node.rb index fd5ea410ea..91c0a32573 100644 --- a/lib/arel/nodes/node.rb +++ b/lib/arel/nodes/node.rb @@ -15,6 +15,16 @@ module Arel 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 engine = Table.engine + viz = Visitors::ToSql.new engine + viz.accept self + end end end end |