[](name)
click to toggle source
114: def [] name
115: ::Arel::Attribute.new self, name
116: end
alias(name = "#{self.name}_2")
click to toggle source
45: def alias name = "#{self.name}_2"
46: Nodes::TableAlias.new(self, name).tap do |node|
47: @aliases << node
48: end
49: end
columns()
click to toggle source
103: def columns
104: if $VERBOSE
105: warn (#{caller.first}) Arel::Table#columns is deprecated and will be removed inArel 4.0.0 with no replacement. PEW PEW PEW!!!
106: end
107: @columns ||=
108: attributes_for @engine.connection.columns(@name, "#{@name} Columns")
109: end
from(table)
click to toggle source
51: def from table
52: SelectManager.new(@engine, table)
53: end
group(*columns)
click to toggle source
75: def group *columns
76: from(self).group(*columns)
77: end
having(expr)
click to toggle source
99: def having expr
100: from(self).having expr
101: end
insert_manager()
click to toggle source
122: def insert_manager
123: InsertManager.new(@engine)
124: end
join(relation, klass = Nodes::InnerJoin)
click to toggle source
63: def join relation, klass = Nodes::InnerJoin
64: return from(self) unless relation
65:
66: case relation
67: when String, Nodes::SqlLiteral
68: raise if relation.blank?
69: klass = Nodes::StringJoin
70: end
71:
72: from(self).join(relation, klass)
73: end
joins(manager)
click to toggle source
55: def joins manager
56: if $VERBOSE
57: warn "joins is deprecated and will be removed in 4.0.0"
58: warn "please remove your call to joins from #{caller.first}"
59: end
60: nil
61: end
order(*expr)
click to toggle source
79: def order *expr
80: from(self).order(*expr)
81: end
primary_key()
click to toggle source
32: def primary_key
33: if $VERBOSE
34: warn primary_key (#{caller.first}) is deprecated and will be removed in ARel 4.0.0
35: end
36: @primary_key ||= begin
37: primary_key_name = @engine.connection.primary_key(name)
38:
39: primary_key_name && self[primary_key_name]
40: end
41: end
project(*things)
click to toggle source
87: def project *things
88: from(self).project(*things)
89: end
select_manager()
click to toggle source
118: def select_manager
119: SelectManager.new(@engine)
120: end
skip(amount)
click to toggle source
95: def skip amount
96: from(self).skip amount
97: end
take(amount)
click to toggle source
91: def take amount
92: from(self).take amount
93: end
where(condition)
click to toggle source
83: def where condition
84: from(self).where condition
85: end