From 9bbfacf490a3c057e72f098aafd545754fcaa23f Mon Sep 17 00:00:00 2001 From: tnicolas1 Date: Fri, 22 Nov 2024 13:44:30 +0100 Subject: [PATCH] =?UTF-8?q?V=C3=A9rifie=20que=20la=20date=20de=20fin=20de?= =?UTF-8?q?=20la=20PFMP=20est=20sup=C3=A9rieur=20=C3=A0=20la=20date=20du?= =?UTF-8?q?=20jour?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/pfmp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/pfmp.rb b/app/models/pfmp.rb index 299206706..7e52be029 100644 --- a/app/models/pfmp.rb +++ b/app/models/pfmp.rb @@ -45,7 +45,7 @@ class Pfmp < ApplicationRecord # rubocop:disable Metrics/ClassLength } validates :end_date, - comparison: { greater_than_or_equal_to: :start_date }, + comparison: { greater_than_or_equal_to: [:start_date, Time.zone.today] }, if: -> { start_date && end_date } validates :amount, numericality: { only_integer: true, allow_nil: true, greater_than_or_equal_to: 0 }