fix(Dossier.processed_in_month): recast date to datetime in scope

This commit is contained in:
Martin 2022-04-02 06:53:30 +02:00 committed by mfo
parent ab777a790c
commit ec78340c06

View file

@ -234,6 +234,7 @@ class Dossier < ApplicationRecord
scope :termine, -> { not_archived.state_termine }
scope :processed_in_month, -> (date) do
date = date.to_datetime
state_termine
.joins(:traitements)
.where(traitements: { processed_at: date.beginning_of_month..date.end_of_month })