Module: Arel::Nodes

Defined in:
activerecord/lib/arel/nodes/in.rb,
activerecord/lib/arel/nodes/and.rb,
activerecord/lib/arel/nodes/case.rb,
activerecord/lib/arel/nodes/node.rb,
activerecord/lib/arel/nodes/over.rb,
activerecord/lib/arel/nodes/true.rb,
activerecord/lib/arel/nodes/with.rb,
activerecord/lib/arel/nodes/count.rb,
activerecord/lib/arel/nodes/false.rb,
activerecord/lib/arel/nodes/unary.rb,
activerecord/lib/arel/nodes/binary.rb,
activerecord/lib/arel/nodes/casted.rb,
activerecord/lib/arel/nodes/regexp.rb,
activerecord/lib/arel/nodes/window.rb,
activerecord/lib/arel/nodes/comment.rb,
activerecord/lib/arel/nodes/extract.rb,
activerecord/lib/arel/nodes/matches.rb,
activerecord/lib/arel/nodes/equality.rb,
activerecord/lib/arel/nodes/function.rb,
activerecord/lib/arel/nodes/grouping.rb,
activerecord/lib/arel/nodes/ordering.rb,
activerecord/lib/arel/nodes/terminal.rb,
activerecord/lib/arel/nodes/ascending.rb,
activerecord/lib/arel/nodes/bind_param.rb,
activerecord/lib/arel/nodes/descending.rb,
activerecord/lib/arel/nodes/inner_join.rb,
activerecord/lib/arel/nodes/outer_join.rb,
activerecord/lib/arel/nodes/join_source.rb,
activerecord/lib/arel/nodes/select_core.rb,
activerecord/lib/arel/nodes/sql_literal.rb,
activerecord/lib/arel/nodes/string_join.rb,
activerecord/lib/arel/nodes/table_alias.rb,
activerecord/lib/arel/nodes/values_list.rb,
activerecord/lib/arel/nodes/named_function.rb,
activerecord/lib/arel/nodes/full_outer_join.rb,
activerecord/lib/arel/nodes/infix_operation.rb,
activerecord/lib/arel/nodes/node_expression.rb,
activerecord/lib/arel/nodes/unary_operation.rb,
activerecord/lib/arel/nodes/delete_statement.rb,
activerecord/lib/arel/nodes/insert_statement.rb,
activerecord/lib/arel/nodes/right_outer_join.rb,
activerecord/lib/arel/nodes/select_statement.rb,
activerecord/lib/arel/nodes/update_statement.rb,
activerecord/lib/arel/nodes/unqualified_column.rb

Defined Under Namespace

Modules: FetchAttribute Classes: Addition, And, Ascending, Between, Binary, BindParam, BitwiseAnd, BitwiseNot, BitwiseOr, BitwiseShiftLeft, BitwiseShiftRight, BitwiseXor, Case, Casted, Comment, Concat, Count, CurrentRow, DeleteStatement, Descending, Distinct, Division, DoesNotMatch, Else, Equality, Extract, False, Following, FullOuterJoin, Function, GreaterThan, GreaterThanOrEqual, Grouping, In, InfixOperation, InnerJoin, InsertStatement, IsDistinctFrom, IsNotDistinctFrom, JoinSource, LessThan, LessThanOrEqual, Matches, Multiplication, NamedFunction, NamedWindow, Node, NodeExpression, NotEqual, NotIn, NotRegexp, NullsFirst, NullsLast, Or, Ordering, OuterJoin, Over, Preceding, Quoted, Range, Regexp, RightOuterJoin, Rows, SelectCore, SelectStatement, SqlLiteral, StringJoin, Subtraction, TableAlias, True, Unary, UnaryOperation, UnqualifiedColumn, UpdateStatement, ValuesList, When, Window, With, WithRecursive

Class Method Summary collapse

Class Method Details

.build_quoted(other, attribute = nil) ⇒ Object


36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'activerecord/lib/arel/nodes/casted.rb', line 36

def self.build_quoted(other, attribute = nil)
  case other
  when Arel::Nodes::Node, Arel::Attributes::Attribute, Arel::Table, Arel::Nodes::BindParam, Arel::SelectManager, Arel::Nodes::Quoted, Arel::Nodes::SqlLiteral
    other
  else
    case attribute
    when Arel::Attributes::Attribute
      Casted.new other, attribute
    else
      Quoted.new other
    end
  end
end