From 96e82c75d6c0614d47f02eea926ed8bb635b3bc0 Mon Sep 17 00:00:00 2001 From: clemkeirua Date: Thu, 9 Jul 2020 16:10:56 +0200 Subject: [PATCH] use more idiomatic update --- app/models/champs/piece_justificative_champ.rb | 2 +- ...1123_add_default_skip_validation_to_piece_justificative.rake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/champs/piece_justificative_champ.rb b/app/models/champs/piece_justificative_champ.rb index 4ed744d09..e808b703a 100644 --- a/app/models/champs/piece_justificative_champ.rb +++ b/app/models/champs/piece_justificative_champ.rb @@ -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 diff --git a/lib/tasks/deployment/20200708101123_add_default_skip_validation_to_piece_justificative.rake b/lib/tasks/deployment/20200708101123_add_default_skip_validation_to_piece_justificative.rake index d9deac68c..7bd74babb 100644 --- a/lib/tasks/deployment/20200708101123_add_default_skip_validation_to_piece_justificative.rake +++ b/lib/tasks/deployment/20200708101123_add_default_skip_validation_to_piece_justificative.rake @@ -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