aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/tree_manager.rb
blob: 24df5e0c0917189d19d83f870b0edd5f82f7e06e (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
module Arel
  class TreeManager
    # FIXME: Remove this.
    include Arel::Relation

    def initialize engine
      @engine = engine
    end

    def to_dot
      Visitors::Dot.new.accept @head
    end

    def to_sql
      viz = Visitors::ToSql.new @engine
      viz.accept @head
    end

    def initialize_copy other
      super
      @head = @head.clone
    end
  end
end