use more idiomatic update

This commit is contained in:
clemkeirua 2020-07-09 16:10:56 +02:00 committed by Keirua (Rebase PR Action)
parent 299c86141c
commit 96e82c75d6
2 changed files with 2 additions and 2 deletions

View file

@ -49,6 +49,6 @@ class Champs::PieceJustificativeChamp < Champ
end
def update_skip_pj_validation
type_de_champ.update(options: type_de_champ.options&.merge({ :skip_pj_validation => true }) || { :skip_pj_validation => true })
type_de_champ.update(skip_pj_validation: true)
end
end

View file

@ -6,7 +6,7 @@ namespace :after_party do
tdcs = TypeDeChamp.where(type_champ: TypeDeChamp.type_champs.fetch(:piece_justificative))
progress = ProgressReport.new(tdcs.count)
tdcs.find_each do |tdc|
tdc.update(options: tdc.options&.merge({ :skip_pj_validation => true }) || { :skip_pj_validation => true })
tdc.update(skip_pj_validation: true)
progress.inc
end
progress.finish