fix(procedure_presentation): find last instance of type_de_champ through coordinates

This commit is contained in:
Paul Chavard 2022-07-28 11:28:17 +02:00
parent 48a4e8bec5
commit 435a635b3d

View file

@ -293,7 +293,11 @@ class ProcedurePresentation < ApplicationRecord
end
def find_type_de_champ(column)
TypeDeChamp.order(:revision_id).find_by(stable_id: column)
TypeDeChamp
.joins(:revision_types_de_champ)
.where(revision_types_de_champ: { revision_id: procedure.revisions })
.order(:created_at)
.find_by(stable_id: column)
end
def check_allowed_displayed_fields