perf(Administrateurs::ConditionsController#*): better perfs
This commit is contained in:
parent
01752bc2e8
commit
b9bbe70ec5
2 changed files with 2 additions and 1 deletions
|
@ -54,6 +54,7 @@ module Administrateurs
|
||||||
end
|
end
|
||||||
|
|
||||||
def retrieve_coordinate_and_uppers
|
def retrieve_coordinate_and_uppers
|
||||||
|
ProcedureRevisionPreloader.load_one(draft_revision)
|
||||||
@tdc = draft_revision.find_and_ensure_exclusive_use(params[:stable_id])
|
@tdc = draft_revision.find_and_ensure_exclusive_use(params[:stable_id])
|
||||||
@coordinate = draft_revision.coordinate_for(@tdc)
|
@coordinate = draft_revision.coordinate_for(@tdc)
|
||||||
@upper_tdcs = @coordinate.upper_coordinates.map(&:type_de_champ)
|
@upper_tdcs = @coordinate.upper_coordinates.map(&:type_de_champ)
|
||||||
|
|
|
@ -31,7 +31,7 @@ class ProcedureRevisionTypeDeChamp < ApplicationRecord
|
||||||
|
|
||||||
def siblings
|
def siblings
|
||||||
if parent_id.present?
|
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?
|
elsif private?
|
||||||
revision.revision_types_de_champ_private
|
revision.revision_types_de_champ_private
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue