Class: Arel::SelectManager

Inherits:
Object
  • Object
show all
Includes:
ArelExtensions::Nodes, ArelExtensions::SetFunctions
Defined in:
lib/arel_extensions.rb

Instance Method Summary collapse

Methods included from ArelExtensions::SetFunctions

#+, #union, #union_all, #uniq

Instance Method Details

#as(table_name) ⇒ Object



239
240
241
# File 'lib/arel_extensions.rb', line 239

def as table_name
  Arel::Nodes::TableAlias.new(self, table_name)
end

#xas(table_name) ⇒ Object

Install an alias, if present.



244
245
246
247
248
249
250
# File 'lib/arel_extensions.rb', line 244

def xas table_name
  if table_name.present?
    as table_name
  else
    self
  end
end