2014-01-02 00:21:49 +01:00
|
|
|
class RegionsController < InheritedResources::Base
|
2014-01-04 11:34:50 +01:00
|
|
|
def icallist
|
2014-01-02 00:21:49 +01:00
|
|
|
@regions = Region.all
|
|
|
|
end
|
2014-01-05 18:48:32 +01:00
|
|
|
|
|
|
|
def stats
|
|
|
|
@regions = Region.all
|
|
|
|
|
|
|
|
@events = Event.group(:city).having('count(city) > 3').order('count(city) desc').count(:city)
|
|
|
|
|
|
|
|
@months = Event
|
|
|
|
.select('extract(year from start_time)')
|
|
|
|
.select('extract(month from start_time)')
|
|
|
|
.group('extract(year from start_time)')
|
|
|
|
.group('extract(month from start_time)')
|
|
|
|
.count()
|
|
|
|
end
|
2014-01-02 00:21:49 +01:00
|
|
|
end
|