aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/relations/aggregation.rb
blob: 7a568341254c13ad041521537868f7aaf815b40e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Aggregation = Struct.new(:relation) do
  def selects
    []
  end
  
  def table
    relation
  end
  
  def relation_for(attribute)
    relation
  end
  
  def table_sql(formatter = Sql::TableReference.new(relation))
    relation.to_sql(formatter)
  end
  
  def attributes
    relation.attributes.collect(&:to_attribute)
  end
end