perf(admin_procedure_show): use partial with collection

This commit is contained in:
simon lehericey 2022-09-30 14:29:44 +02:00 committed by LeSim
parent e043725d51
commit 7af248b4bf

View file

@ -4,8 +4,9 @@
- else - else
- changes.filter { |change| change[:model] == :attestation_template }.each do |change| - changes.filter { |change| change[:model] == :attestation_template }.each do |change|
= render partial: 'administrateurs/procedures/revision_change_attestation_template', locals: { change: change } = render partial: 'administrateurs/procedures/revision_change_attestation_template', locals: { change: change }
- changes.filter { |change| change[:model] == :type_de_champ }.each do |change| = render partial: "administrateurs/procedures/revision_change_type_de_champ",
= render partial: 'administrateurs/procedures/revision_change_type_de_champ', locals: { change: change } collection: changes.filter { |change| change[:model] == :type_de_champ },
as: :change
- move_changes, move_private_changes = changes.filter { |change| change[:op] == :move }.partition { |change| !change[:private] } - move_changes, move_private_changes = changes.filter { |change| change[:op] == :move }.partition { |change| !change[:private] }
- if move_changes.present? - if move_changes.present?
%li.mb-1= t(:move, scope: [:administrateurs, :revision_changes], count: move_changes.size) %li.mb-1= t(:move, scope: [:administrateurs, :revision_changes], count: move_changes.size)