diff --git a/app/controllers/administrateurs/conditions_controller.rb b/app/controllers/administrateurs/conditions_controller.rb index 30a443f21..74107500b 100644 --- a/app/controllers/administrateurs/conditions_controller.rb +++ b/app/controllers/administrateurs/conditions_controller.rb @@ -54,6 +54,7 @@ module Administrateurs end def retrieve_coordinate_and_uppers + ProcedureRevisionPreloader.load_one(draft_revision) @tdc = draft_revision.find_and_ensure_exclusive_use(params[:stable_id]) @coordinate = draft_revision.coordinate_for(@tdc) @upper_tdcs = @coordinate.upper_coordinates.map(&:type_de_champ) diff --git a/app/models/procedure_revision_type_de_champ.rb b/app/models/procedure_revision_type_de_champ.rb index 2c27f26bf..c4842da20 100644 --- a/app/models/procedure_revision_type_de_champ.rb +++ b/app/models/procedure_revision_type_de_champ.rb @@ -31,7 +31,7 @@ class ProcedureRevisionTypeDeChamp < ApplicationRecord def siblings if parent_id.present? - revision.revision_types_de_champ.filter { _1.parent_id == parent_id } + revision.revision_types_de_champ.where(parent_id: parent_id).ordered elsif private? revision.revision_types_de_champ_private else