Class: Arel::TreeManager
Instance Attribute Summary collapse
Instance Method Summary
collapse
#create_and, #create_false, #create_join, #create_on, #create_string_join, #create_table_alias, #create_true, #grouping, #lower
Constructor Details
Returns a new instance of TreeManager.
10
11
12
|
# File 'lib/arel/tree_manager.rb', line 10
def initialize
@ctx = nil
end
|
Instance Attribute Details
#ast ⇒ Object
Returns the value of attribute ast.
8
9
10
|
# File 'lib/arel/tree_manager.rb', line 8
def ast
@ast
end
|
Instance Method Details
#initialize_copy(other) ⇒ Object
26
27
28
29
|
# File 'lib/arel/tree_manager.rb', line 26
def initialize_copy other
super
@ast = @ast.clone
end
|
#to_sql(engine = Table.engine) ⇒ Object
20
21
22
23
24
|
# File 'lib/arel/tree_manager.rb', line 20
def to_sql engine = Table.engine
collector = Arel::Collectors::SQLString.new
collector = engine.connection.visitor.accept @ast, collector
collector.value
end
|
#where(expr) ⇒ Object
31
32
33
34
35
36
37
|
# File 'lib/arel/tree_manager.rb', line 31
def where expr
if Arel::TreeManager === expr
expr = expr.ast
end
@ctx.wheres << expr
self
end
|