Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bloquer la validation d'une PFMP si sa date de fin est supérieure à la date du jour #1234

Closed
wants to merge 4 commits into from

Conversation

tnicolas1
Copy link
Collaborator

No description provided.

@tnicolas1 tnicolas1 force-pushed the feat/pfmp-greater-than-today branch 3 times, most recently from b0c3e3a to 9c099d5 Compare November 22, 2024 14:11
app/models/pfmp.rb Outdated Show resolved Hide resolved
@tnicolas1 tnicolas1 changed the title Bloquer la saisie d'une PFMP si sa date de fin est supérieure à la date du jour Bloquer la saisie d'une PFMP si sa date de fin est inférieure à la date du jour Nov 22, 2024
Copy link
Collaborator

@pskl pskl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je propose un truc du genre:

 validates :end_date,
            :start_date,
            if: ->(pfmp) { pfmp.schooling.present? },
            inclusion: {
              in: lambda { |pfmp|
                pfmp.schooling.establishment.school_year_range(
                  pfmp.school_year.start_year,
                  pfmp.schooling.extended_end_date || Date.current
                )
              }
            }

@tnicolas1 tnicolas1 changed the title Bloquer la saisie d'une PFMP si sa date de fin est inférieure à la date du jour Bloquer la saisie d'une PFMP si sa date de fin est supérieure à la date du jour Nov 22, 2024
@tnicolas1 tnicolas1 changed the title Bloquer la saisie d'une PFMP si sa date de fin est supérieure à la date du jour Bloquer la validation d'une PFMP si sa date de fin est supérieure à la date du jour Nov 25, 2024
@tnicolas1 tnicolas1 requested a review from pskl November 25, 2024 12:08
@tnicolas1 tnicolas1 closed this Nov 25, 2024
@tnicolas1 tnicolas1 deleted the feat/pfmp-greater-than-today branch November 25, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EVO] Bloquer la saisie du nombre de jour d'une PFMP si elle n'est pas terminée
2 participants