[](name)
click to toggle source
def [] name
::Arel::Attribute.new self, name
end
alias(name = "#{self.name}_2")
click to toggle source
def alias name = "#{self.name}_2"
Nodes::TableAlias.new(self, name).tap do |node|
@aliases << node
end
end
columns()
click to toggle source
def columns
if $VERBOSE
warn (#{caller.first}) Arel::Table#columns is deprecated and will be removed inArel 4.0.0 with no replacement. PEW PEW PEW!!!
end
@columns ||=
attributes_for @engine.connection.columns(@name, "#{@name} Columns")
end
from(table)
click to toggle source
def from table
SelectManager.new(@engine, table)
end
group(*columns)
click to toggle source
def group *columns
from(self).group(*columns)
end
having(expr)
click to toggle source
def having expr
from(self).having expr
end
insert_manager()
click to toggle source
def insert_manager
InsertManager.new(@engine)
end
join(relation, klass = Nodes::InnerJoin)
click to toggle source
def join relation, klass = Nodes::InnerJoin
return from(self) unless relation
case relation
when String, Nodes::SqlLiteral
raise if relation.blank?
klass = Nodes::StringJoin
end
from(self).join(relation, klass)
end
joins(manager)
click to toggle source
def joins manager
if $VERBOSE
warn "joins is deprecated and will be removed in 4.0.0"
warn "please remove your call to joins from #{caller.first}"
end
nil
end
order(*expr)
click to toggle source
def order *expr
from(self).order(*expr)
end
primary_key()
click to toggle source
def primary_key
if $VERBOSE
warn primary_key (#{caller.first}) is deprecated and will be removed in ARel 4.0.0
end
@primary_key ||= begin
primary_key_name = @engine.connection.primary_key(name)
primary_key_name && self[primary_key_name]
end
end
project(*things)
click to toggle source
def project *things
from(self).project(*things)
end
select_manager()
click to toggle source
def select_manager
SelectManager.new(@engine)
end
skip(amount)
click to toggle source
def skip amount
from(self).skip amount
end
take(amount)
click to toggle source
def take amount
from(self).take amount
end
where(condition)
click to toggle source
def where condition
from(self).where condition
end