2010-08-12 19:19:54 -04:00
|
|
|
module Arel
|
|
|
|
class TreeManager
|
2010-08-13 15:26:06 -04:00
|
|
|
# FIXME: Remove this.
|
|
|
|
include Arel::Relation
|
|
|
|
|
2010-08-12 19:19:54 -04:00
|
|
|
def initialize engine
|
2010-08-13 18:30:22 -04:00
|
|
|
@engine = engine
|
2010-08-12 19:19:54 -04:00
|
|
|
end
|
|
|
|
|
2010-08-16 17:09:48 -04:00
|
|
|
def to_dot
|
|
|
|
Visitors::Dot.new.accept @head
|
|
|
|
end
|
|
|
|
|
2010-08-12 19:19:54 -04:00
|
|
|
def to_sql
|
|
|
|
viz = Visitors::ToSql.new @engine
|
2010-08-13 18:30:22 -04:00
|
|
|
viz.accept @head
|
2010-08-12 19:19:54 -04:00
|
|
|
end
|
2010-08-16 23:33:41 -04:00
|
|
|
|
|
|
|
def initialize_copy other
|
|
|
|
super
|
|
|
|
@head = @head.clone
|
|
|
|
end
|
2010-08-12 19:19:54 -04:00
|
|
|
end
|
|
|
|
end
|