Merge pull request #3703 from betagouv/frederic/fix_migration_updated_at

[#2180] Fix updated_at for migration PJ champs
This commit is contained in:
Frederic Merizen 2019-03-28 18:02:12 +01:00 committed by GitHub
commit bd265c6f32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,12 +37,12 @@ class PieceJustificativeToChampPieceJointeMigrationService
pj = dossier.retrieve_last_piece_justificative_by_type(type_pj_id) pj = dossier.retrieve_last_piece_justificative_by_type(type_pj_id)
if pj.present? if pj.present?
convert_pj_to_champ!(pj, champ)
champ.update( champ.update(
updated_at: pj.updated_at, updated_at: pj.updated_at,
created_at: pj.created_at created_at: pj.created_at
) )
convert_pj_to_champ!(pj, champ)
else else
champ.update( champ.update(
updated_at: dossier.updated_at, updated_at: dossier.updated_at,