Class: Arel::Compound
- Inherits:
-
Object
show all
- Includes:
- Relation
- Defined in:
- lib/arel/engines/memory/relations/compound.rb,
lib/arel/algebra/relations/utilities/compound.rb,
lib/arel/engines/sql/relations/utilities/compound.rb
Direct Known Subclasses
Alias, Deletion, Externalization, From, Group, Having, Insert, Lock, Order, Project, Skip, Take, Update, Where
Instance Attribute Summary collapse
Attributes included from Relation
#count
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Relation
#bind, #call, #christener, #compiler, #exclusion_predicate_sql, #externalizable?, #externalize, #inclusion_predicate_sql, #join?, #primary_key, #session, #to_sql
#groupings, #havings, #inserts, #joins, #locked, #orders, #projections, #skipped, #sources, #taken, #wheres
#[], #find_attribute_matching_attribute, #find_attribute_matching_name, #position_of
#alias, #join, #lock, #outer_join
#delete, #insert, #update
#each, #first
Instance Attribute Details
#relation ⇒ Object
Returns the value of attribute relation.
5
6
7
|
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 5
def relation
@relation
end
|
Class Method Details
.requires(feature = nil) ⇒ Object
10
11
12
13
14
|
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 10
def self.requires(feature = nil)
@requires ||= nil
@requires = feature if feature
@requires
end
|
Instance Method Details
#attributes ⇒ Object
24
25
26
|
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 24
def attributes
@attributes ||= relation.attributes.bind(self)
end
|
#build_query(*parts) ⇒ Object
5
6
7
|
# File 'lib/arel/engines/sql/relations/utilities/compound.rb', line 5
def build_query(*parts)
parts.compact.join(" ")
end
|
#engine ⇒ Object
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 36
def engine
requires = self.class.requires
engine = relation.engine
if requires && engine.respond_to?(:supports) && !engine.supports(requires)
Memory::Engine.new
else
engine
end
end
|
#eql?(other) ⇒ Boolean
32
33
34
|
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 32
def eql?(other)
self == other
end
|
#hash ⇒ Object
28
29
30
|
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 28
def hash
@hash ||= :relation.hash
end
|
#unoperated_rows ⇒ Object
5
6
7
|
# File 'lib/arel/engines/memory/relations/compound.rb', line 5
def unoperated_rows
relation.call.collect { |row| row.bind(self) }
end
|