diff --git a/app/controllers/regions_controller.rb b/app/controllers/regions_controller.rb index 770ffd850b4bc4405250a3dc76e03cef986c7e62..1f001d0e18b8a3cc4af90bef5f6bcea9e4a1776f 100644 --- a/app/controllers/regions_controller.rb +++ b/app/controllers/regions_controller.rb @@ -4,9 +4,12 @@ class RegionsController < InheritedResources::Base @city_events = Event.group(:city).having('count(city) > 3').order('count(city) desc').count(:city) + # Used in sqlite + #.group('strftime("%Y", start_time)') + #.group('strftime("%m", start_time)') @month_events = Event - .group('strftime("%Y", start_time)') - .group('strftime("%m", start_time)') + .group('extract(year from start_time)') + .group('extract(month from start_time)') .count() end end