blob: d74f111271c573e511c5b3f8396d85da58151c1d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
module Arel
class Projection < Compound
attr_reader :projections
def initialize(relation, *projections)
@relation, @projections = relation, projections
end
def attributes
@attributes ||= projections.collect { |p| p.bind(self) }
end
def aggregation?
attributes.any?(&:aggregation?)
end
def ==(other)
Projection === other and
relation == other.relation and
projections == other.projections
end
end
end
|