Class: Arel::TreeManager
Do not use. This class is for internal use only.
| Relationships & Source Files | |
| Namespace Children | |
|
Modules:
| |
| Extension / Inclusion / Inheritance Descendants | |
|
Subclasses:
|
|
| Super Chains via Extension / Inclusion / Inheritance | |
|
Instance Chain:
self,
FactoryMethods
|
|
| Inherits: | Object |
| Defined in: | activerecord/lib/arel/tree_manager.rb |
Class Method Summary
- .new(table = nil) ⇒ TreeManager constructor
Instance Attribute Summary
- #ast readonly
Instance Method Summary
FactoryMethods - Included
| #cast, #coalesce, #create_and, #create_false, #create_join, #create_on, #create_string_join, #create_table_alias, #create_true, #grouping, | |
| #lower | Create a LOWER() function. |
Constructor Details
.new(table = nil) ⇒ TreeManager
# File 'activerecord/lib/arel/tree_manager.rb', line 47
def initialize(table = nil) @table = table end
Instance Attribute Details
#ast (readonly)
[ GitHub ]# File 'activerecord/lib/arel/tree_manager.rb', line 45
attr_reader :ast
Instance Method Details
#initialize_copy(other)
[ GitHub ]# File 'activerecord/lib/arel/tree_manager.rb', line 70
def initialize_copy(other) super @ast = @ast.clone end
#to_dot
[ GitHub ]# File 'activerecord/lib/arel/tree_manager.rb', line 51
def to_dot collector = Arel::Collectors::PlainString.new collector = Visitors::Dot.new.accept @ast, collector collector.value end
#to_sql(engine = nil)
[ GitHub ]# File 'activerecord/lib/arel/tree_manager.rb', line 57
def to_sql(engine = nil) unless engine table = @table.is_a?(Nodes::JoinSource) ? @table.left : @table engine = table&.klass || Table.engine end collector = Arel::Collectors::SQLString.new engine.with_connection do |connection| connection.visitor.accept(@ast, collector).value end end