This commit is contained in:
Joffrey JAFFEUX 2018-04-26 17:19:44 +02:00 committed by GitHub
parent b9c7e09a4e
commit 73a1be0d57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -21,8 +21,8 @@ module DateGroupable extend ActiveSupport::Concern
end end
def group_by_unit(aggregation_unit, column) def group_by_unit(aggregation_unit, column)
group("date_trunc('#{aggregation_unit}', #{column})") group("date_trunc('#{aggregation_unit}', #{column})::DATE")
.order("date_trunc('#{aggregation_unit}', #{column})") .order("date_trunc('#{aggregation_unit}', #{column})::DATE")
end end
def smart_group_by_date(column, start_date, end_date) def smart_group_by_date(column, start_date, end_date)