From a15ff36a221add4ff42372a764b25c924077dd8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 17 May 2024 00:38:44 +0200 Subject: [PATCH] Apply Rails/SafeNavigation in officing booth view In commit 9329e4b6e, `try` was added because there was a case where this partial was rendered and the `current_booth` method didn't exist. However, that's no longer the case since commit d5c7858f6. Since then, this partial is only rendered in the officing section, where the `current_booth` method is defined. So we can use the safe navigation operator instead of `try`. --- app/views/layouts/_officing_booth.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_officing_booth.html.erb b/app/views/layouts/_officing_booth.html.erb index 4b039584a..d629ccf0a 100644 --- a/app/views/layouts/_officing_booth.html.erb +++ b/app/views/layouts/_officing_booth.html.erb @@ -1,5 +1,5 @@ <% if current_user.poll_officer? %>
- <%= t("admin.officing_booth.title", booth: try(:current_booth)&.location) %> + <%= t("admin.officing_booth.title", booth: current_booth&.location) %>
<% end %>