perf(Administrateurs::ConditionsController#*): better perfs

This commit is contained in:
Martin 2024-01-26 14:54:03 +01:00
parent 01752bc2e8
commit b9bbe70ec5
2 changed files with 2 additions and 1 deletions

View file

@ -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)

View file

@ -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