From e7078279b80834875b3267b89739ab9142177d29 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Fri, 20 May 2022 14:20:26 +0200 Subject: [PATCH] rename published to target to be coherent --- app/models/concerns/dossier_rebase_concern.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/concerns/dossier_rebase_concern.rb b/app/models/concerns/dossier_rebase_concern.rb index 5c77f373f..cc9ca8138 100644 --- a/app/models/concerns/dossier_rebase_concern.rb +++ b/app/models/concerns/dossier_rebase_concern.rb @@ -67,7 +67,7 @@ module DossierRebaseConcern current_types_de_champ_by_stable_id = revision.types_de_champ.index_by(&:stable_id) # index published types de champ coordinates by stable_id - published_coordinates_by_stable_id = target_revision + target_coordinates_by_stable_id = target_revision .revision_types_de_champ .includes(:type_de_champ, :parent) .index_by(&:stable_id) @@ -75,7 +75,7 @@ module DossierRebaseConcern # add and remove champs changes_by_stable_id.each do |stable_id, changes| type_de_champ = current_types_de_champ_by_stable_id[stable_id] - published_coordinate = published_coordinates_by_stable_id[stable_id] + published_coordinate = target_coordinates_by_stable_id[stable_id] changes.each do |change| case change[:op] @@ -90,7 +90,7 @@ module DossierRebaseConcern # find all champs with respective update changes and the published type de champ champs_with_changes = Champ.where(dossier: self).includes(:type_de_champ).filter_map do |champ| # type de champ from published revision - type_de_champ = published_coordinates_by_stable_id[champ.stable_id]&.type_de_champ + type_de_champ = target_coordinates_by_stable_id[champ.stable_id]&.type_de_champ # only update op changes changes = (changes_by_stable_id[champ.stable_id] || []).filter { |change| change[:op] == :update }