demarches-normaliennes/app/components/procedure/card/emails_component.rb
2022-11-04 09:08:41 +00:00

17 lines
478 B
Ruby

class Procedure::Card::EmailsComponent < ApplicationComponent
def initialize(procedure:)
@procedure = procedure
end
private
def error_messages
[
@procedure.errors.messages_for(:initiated_mail),
@procedure.errors.messages_for(:received_mail),
@procedure.errors.messages_for(:closed_mail),
@procedure.errors.messages_for(:refused_mail),
@procedure.errors.messages_for(:without_continuation_mail)
].flatten.to_sentence
end
end