From 6325df25b87e00a5d2ebdab8dde94f10d17cc975 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sun, 24 Nov 2019 11:36:55 +1300 Subject: [PATCH] Make the month an int --- app/models/concerns/predict_harvest.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/concerns/predict_harvest.rb b/app/models/concerns/predict_harvest.rb index a552735b3..51224a2a6 100644 --- a/app/models/concerns/predict_harvest.rb +++ b/app/models/concerns/predict_harvest.rb @@ -57,7 +57,7 @@ module PredictHarvest def harvest_months Rails.cache.fetch("#{cache_key_with_version}/harvest_months", expires_in: 5.minutes) do neighbours_for_harvest_predictions.where.not(harvested_at: nil) - .group("extract(MONTH from harvested_at)") + .group("extract(MONTH from harvested_at)::int") .count end end