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



270
271
272
# File 'lib/arel_extensions.rb', line 270

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

#xas(table_name) ⇒ Object

Install an alias, if present.



275
276
277
278
279
280
281
# File 'lib/arel_extensions.rb', line 275

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