From 0ccb188aac0cb708c68c2e0499e9393e689a57ee Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Fri, 27 Sep 2024 16:25:52 +0200 Subject: [PATCH] chore: valid_action? -> accessible_action? --- app/views/manager/instructeurs/show.html.erb | 2 +- app/views/manager/outdated_procedures/index.html.erb | 2 +- app/views/manager/procedures/show.html.erb | 2 +- app/views/manager/published_procedures/index.html.erb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/manager/instructeurs/show.html.erb b/app/views/manager/instructeurs/show.html.erb index 4ce7efb4b..7c71ef8a6 100644 --- a/app/views/manager/instructeurs/show.html.erb +++ b/app/views/manager/instructeurs/show.html.erb @@ -29,7 +29,7 @@ as well as a link to its edit page. 'Modifier', [:edit, namespace, page.resource], class: "button", - ) if valid_action?(:edit) && show_action?(:edit, page.resource) %> + ) if accessible_action?(:edit, page.resource) && show_action?(:edit, page.resource) %> <%= link_to 'Réinviter', reinvite_manager_instructeur_path(instructeur), method: :post, class: 'button' %> diff --git a/app/views/manager/outdated_procedures/index.html.erb b/app/views/manager/outdated_procedures/index.html.erb index 8317246ba..e2339dae1 100644 --- a/app/views/manager/outdated_procedures/index.html.erb +++ b/app/views/manager/outdated_procedures/index.html.erb @@ -48,7 +48,7 @@ It renders the `_table` partial to display details about the resources. ), [:new, namespace, page.resource_path.to_sym], class: "button", - ) if valid_action?(:new) && show_action?(:new, new_resource) %> + ) if accessible_action?(:new, page.resource) && show_action?(:new, new_resource) %> diff --git a/app/views/manager/procedures/show.html.erb b/app/views/manager/procedures/show.html.erb index 92974d30a..82ff536cb 100644 --- a/app/views/manager/procedures/show.html.erb +++ b/app/views/manager/procedures/show.html.erb @@ -31,7 +31,7 @@ as well as a link to its edit page. t("administrate.actions.edit_resource", name: page.page_title), [:edit, namespace, page.resource], class: "button", - ) if valid_action? :edit %> + ) if accessible_action?(:edit, page.resource) %> <%= link_to 'Aperçu', apercu_admin_procedure_path(procedure), class: 'button' %> diff --git a/app/views/manager/published_procedures/index.html.erb b/app/views/manager/published_procedures/index.html.erb index 8317246ba..e2339dae1 100644 --- a/app/views/manager/published_procedures/index.html.erb +++ b/app/views/manager/published_procedures/index.html.erb @@ -48,7 +48,7 @@ It renders the `_table` partial to display details about the resources. ), [:new, namespace, page.resource_path.to_sym], class: "button", - ) if valid_action?(:new) && show_action?(:new, new_resource) %> + ) if accessible_action?(:new, page.resource) && show_action?(:new, new_resource) %>