Module: ArelExtensions::Aliases

Included in:
Arel::Nodes::Function, Attributes, Nodes::Case
Defined in:
lib/arel_extensions/aliases.rb

Instance Method Summary collapse

Instance Method Details

#xas(other) ⇒ Object

Install an alias, if present.



5
6
7
8
9
10
11
# File 'lib/arel_extensions/aliases.rb', line 5

def xas other
  if other.present?
    Arel::Nodes::As.new(self, Arel.sql(other))
  else
    self
  end
end