Merge pull request #9956 from mfo/US/amelioration-rebase
tech(perf.rebase): améliore la performance pour réconcilier les dossiers d'une procédure lorsqu'un administrateur change le formulaire (donc nouveau milésime 🍷)
This commit is contained in:
commit
86fb28bda0
1 changed files with 2 additions and 1 deletions
|
@ -2,6 +2,7 @@ module DossierRebaseConcern
|
|||
extend ActiveSupport::Concern
|
||||
|
||||
def rebase!(force: false)
|
||||
ProcedureRevisionPreloader.new([procedure.published_revision, revision].compact).all
|
||||
return if procedure.published_revision.blank?
|
||||
|
||||
if force || can_rebase?
|
||||
|
@ -57,7 +58,7 @@ module DossierRebaseConcern
|
|||
.tap { _1.default = [] }
|
||||
|
||||
champs_by_stable_id = champs
|
||||
.joins(:type_de_champ)
|
||||
.includes(:type_de_champ)
|
||||
.group_by(&:stable_id)
|
||||
.transform_values { Champ.where(id: _1) }
|
||||
.tap { _1.default = Champ.none }
|
||||
|
|
Loading…
Reference in a new issue