123456789_123456789_123456789_123456789_123456789_

Module: Arel::FactoryMethods

Do not use. This module is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
DeleteManager, InsertManager, Nodes::Addition, Nodes::As, Nodes::Ascending, Nodes::Between, Nodes::Binary, Nodes::BindParam, Nodes::BitwiseAnd, Nodes::BitwiseNot, Nodes::BitwiseOr, Nodes::BitwiseShiftLeft, Nodes::BitwiseShiftRight, Nodes::BitwiseXor, Nodes::BoundSqlLiteral, Nodes::Case, Nodes::Casted, Nodes::Comment, Nodes::Concat, Nodes::Contains, Nodes::Count, Nodes::Cte, Nodes::CurrentRow, Nodes::DeleteStatement, Nodes::Descending, Nodes::Distinct, Nodes::Division, Nodes::DoesNotMatch, Nodes::Else, Nodes::Equality, Nodes::Extract, Nodes::False, Nodes::Filter, Nodes::Following, Nodes::Fragments, Nodes::Function, Nodes::GreaterThan, Nodes::GreaterThanOrEqual, Nodes::Grouping, Nodes::HomogeneousIn, Nodes::In, Nodes::InfixOperation, Nodes::InsertStatement, Nodes::IsDistinctFrom, Nodes::IsNotDistinctFrom, Nodes::JoinSource, Nodes::LessThan, Nodes::LessThanOrEqual, Nodes::Matches, Nodes::Multiplication, Nodes::NamedFunction, Nodes::NamedWindow, Nodes::Nary, Nodes::Node, Nodes::NodeExpression, Nodes::NotEqual, Nodes::NotIn, Nodes::NotRegexp, Nodes::NullsFirst, Nodes::NullsLast, Nodes::Ordering, Nodes::Over, Nodes::Overlaps, Nodes::Preceding, Nodes::Quoted, Nodes::Range, Nodes::Regexp, Nodes::Rows, Nodes::SelectCore, Nodes::SelectStatement, Nodes::Subtraction, Nodes::TableAlias, Nodes::True, Nodes::Unary, Nodes::UnaryOperation, Nodes::UnqualifiedColumn, Nodes::UpdateStatement, Nodes::ValuesList, Nodes::When, Nodes::Window, Nodes::With, Nodes::WithRecursive, SelectManager, Table, TreeManager, UpdateManager
Defined in: activerecord/lib/arel/factory_methods.rb

Overview

Methods for creating various nodes

Instance Method Summary

Instance Method Details

#cast(name, type)

[ GitHub ]

  
# File 'activerecord/lib/arel/factory_methods.rb', line 49

def cast(name, type)
  Nodes::NamedFunction.new "CAST", [name.as(type)]
end

#coalesce(*exprs)

[ GitHub ]

  
# File 'activerecord/lib/arel/factory_methods.rb', line 45

def coalesce(*exprs)
  Nodes::NamedFunction.new "COALESCE", exprs
end

#create_and(clauses)

[ GitHub ]

  
# File 'activerecord/lib/arel/factory_methods.rb', line 27

def create_and(clauses)
  Nodes::And.new clauses
end

#create_false

[ GitHub ]

  
# File 'activerecord/lib/arel/factory_methods.rb', line 11

def create_false
  Arel::Nodes::False.new
end

#create_join(to, constraint = nil, klass = Nodes::InnerJoin)

[ GitHub ]

  
# File 'activerecord/lib/arel/factory_methods.rb', line 19

def create_join(to, constraint = nil, klass = Nodes::InnerJoin)
  klass.new(to, constraint)
end

#create_on(expr)

[ GitHub ]

  
# File 'activerecord/lib/arel/factory_methods.rb', line 31

def create_on(expr)
  Nodes::On.new expr
end

#create_string_join(to)

[ GitHub ]

  
# File 'activerecord/lib/arel/factory_methods.rb', line 23

def create_string_join(to)
  create_join to, nil, Nodes::StringJoin
end

#create_table_alias(relation, name)

[ GitHub ]

  
# File 'activerecord/lib/arel/factory_methods.rb', line 15

def create_table_alias(relation, name)
  Nodes::TableAlias.new(relation, name)
end

#create_true

[ GitHub ]

  
# File 'activerecord/lib/arel/factory_methods.rb', line 7

def create_true
  Arel::Nodes::True.new
end

#grouping(expr)

[ GitHub ]

  
# File 'activerecord/lib/arel/factory_methods.rb', line 35

def grouping(expr)
  Nodes::Grouping.new expr
end

#lower(column)

Create a LOWER() function

[ GitHub ]

  
# File 'activerecord/lib/arel/factory_methods.rb', line 41

def lower(column)
  Nodes::NamedFunction.new "LOWER", [Nodes.build_quoted(column)]
end