Class: Arel::Sql::WhereCondition

Inherits:
Formatter show all
Defined in:
lib/arel/engines/sql/formatters.rb

Direct Known Subclasses

Attribute, Value

Instance Attribute Summary

Attributes inherited from Formatter

#environment

Instance Method Summary collapse

Methods inherited from Formatter

#initialize

Constructor Details

This class inherits a constructor from Arel::Sql::Formatter

Instance Method Details

#attribute(attribute) ⇒ Object



67
68
69
# File 'lib/arel/engines/sql/formatters.rb', line 67

def attribute(attribute)
  "#{quote_table_name(name_for(attribute.original_relation))}.#{quote_column_name(attribute.name)}"
end

#expression(expression) ⇒ Object



71
72
73
# File 'lib/arel/engines/sql/formatters.rb', line 71

def expression(expression)
  "#{expression.function_sql}(#{expression.attribute.to_sql(self)})"
end

#scalar(value, column = nil) ⇒ Object



79
80
81
# File 'lib/arel/engines/sql/formatters.rb', line 79

def scalar(value, column = nil)
  quote(value, column)
end

#select(select_sql, table) ⇒ Object



83
84
85
# File 'lib/arel/engines/sql/formatters.rb', line 83

def select(select_sql, table)
  "(#{select_sql})"
end

#value(value) ⇒ Object



75
76
77
# File 'lib/arel/engines/sql/formatters.rb', line 75

def value(value)
  value.to_sql(self)
end