[#2604] Introduce errors when retrieving ProcedurePresentation

This commit is contained in:
Frederic Merizen 2018-10-23 11:39:54 +02:00
parent 84cac7a5c2
commit 7baa239095
5 changed files with 21 additions and 9 deletions

View file

@ -3,7 +3,7 @@ class AssignTo < ApplicationRecord
belongs_to :gestionnaire
has_one :procedure_presentation, dependent: :destroy
def procedure_presentation_or_default
procedure_presentation || build_procedure_presentation
def procedure_presentation_or_default_and_errors
[procedure_presentation || build_procedure_presentation, nil]
end
end