From 73a1be0d579aad00df059e066248745013f1fb77 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 26 Apr 2018 17:19:44 +0200 Subject: [PATCH] Fix spec --- app/models/concerns/date_groupable.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/concerns/date_groupable.rb b/app/models/concerns/date_groupable.rb index 217aaf2dc73..165a5f35527 100644 --- a/app/models/concerns/date_groupable.rb +++ b/app/models/concerns/date_groupable.rb @@ -21,8 +21,8 @@ module DateGroupable extend ActiveSupport::Concern end def group_by_unit(aggregation_unit, column) - group("date_trunc('#{aggregation_unit}', #{column})") - .order("date_trunc('#{aggregation_unit}', #{column})") + group("date_trunc('#{aggregation_unit}', #{column})::DATE") + .order("date_trunc('#{aggregation_unit}', #{column})::DATE") end def smart_group_by_date(column, start_date, end_date)