Merge pull request #2155 from tchak/fix-cerfa-to-pj

Fix cerfa to pj task
This commit is contained in:
Paul Chavard 2018-06-27 04:24:12 -05:00 committed by GitHub
commit 01481ddefb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,9 +3,9 @@ namespace :'2018_05_21_cerfa_to_pj' do
dossiers = Cerfa.includes(dossier: [:procedure]).all.reject(&:empty?).map(&:dossier).compact.uniq
dossiers.group_by(&:procedure).each do |procedure, dossiers|
if !procedure.type_de_champs.find_by(libelle: 'CERFA')
if !procedure.types_de_champ.find_by(libelle: 'CERFA')
procedure.administrateur.enable_feature(:champ_pj)
type_de_champ = procedure.type_de_champs.create(
type_de_champ = procedure.types_de_champ.create(
type_champ: 'piece_justificative',
libelle: 'CERFA'
)