Make the month an int

This commit is contained in:
Brenda Wallace
2019-11-24 11:36:55 +13:00
parent b8c1f10907
commit 6325df25b8

View File

@@ -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