Restore previous behavior in Dossier

This commit is contained in:
Guillaume Lazzara 2016-02-04 10:39:07 +01:00
parent e20de3dba9
commit b7ea7c9fcf

View file

@ -26,7 +26,7 @@ class Dossier < ActiveRecord::Base
delegate :types_de_champ, to: :procedure
before_save :build_default_cerfa, if: Proc.new { procedure_id_changed? }
after_save :build_default_cerfa, if: Proc.new { procedure.cerfa_flag? && procedure_id_changed? }
after_save :build_default_pieces_justificatives, if: Proc.new { procedure_id_changed? }
after_save :build_default_champs, if: Proc.new { procedure_id_changed? }
@ -195,7 +195,7 @@ class Dossier < ActiveRecord::Base
private
def build_default_cerfa
build_cerfa if procedure.cerfa_flag?
build_cerfa
true
end