From 847ff2b16b3925e3a2eb6b3763651e420f2e6b33 Mon Sep 17 00:00:00 2001 From: Amolith Date: Thu, 4 Dec 2025 14:16:45 -0700 Subject: [PATCH] refactor(admin_command): simplify to ternary registered? never returns nil, no need to handle it --- lib/admin_command.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/admin_command.rb b/lib/admin_command.rb index 0fe943bdbc7a8154ff201d884d0a83682081826b..f01c4bfed49451c62d1c5a1ccab074f3b0c947f2 100644 --- a/lib/admin_command.rb +++ b/lib/admin_command.rb @@ -87,7 +87,7 @@ class AdminCommand reg = @target_customer.registered? vars = { notice: notice, customer_id: @target_customer.customer_id, - jid: @target_customer.jid, tel: (reg || nil)&.phone } + jid: @target_customer.jid, tel: reg ? reg.phone : nil } reply(FormTemplate.render("admin_menu", **vars)).then do |response| if response.form.field("action") handle(response.form.field("action").value, response.action)