Rapide correction, mysql ne comprend que la fonction extract pour extraire mois et année
This commit is contained in:
parent
4320902f06
commit
f7ecdfdfbf
@ -4,9 +4,12 @@ class RegionsController < InheritedResources::Base
|
|||||||
|
|
||||||
@city_events = Event.group(:city).having('count(city) > 3').order('count(city) desc').count(:city)
|
@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
|
@month_events = Event
|
||||||
.group('strftime("%Y", start_time)')
|
.group('extract(year from start_time)')
|
||||||
.group('strftime("%m", start_time)')
|
.group('extract(month from start_time)')
|
||||||
.count()
|
.count()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user