demarches-normaliennes/app/components/procedure/card/ineligibilite_dossier_component.rb

20 lines
460 B
Ruby
Raw Normal View History

class Procedure::Card::IneligibiliteDossierComponent < ApplicationComponent
def initialize(procedure:)
@procedure = procedure
end
def ready?
@procedure.draft_revision
.conditionable_types_de_champ
.present? && @procedure.draft_revision.ineligibilite_enabled
end
def error?
!@procedure.draft_revision.validate(:ineligibilite_rules_editor)
end
def completed?
@procedure.draft_revision.ineligibilite_enabled
end
end