From 34250ac305b5258d2125acb1e663a4782ac1f646 Mon Sep 17 00:00:00 2001 From: Wabo Date: Tue, 19 May 2026 16:15:46 -0400 Subject: [PATCH] Fix lingering erblint failures in sms_settings/index.html.erb The previous lint fix swapped a `<% ... %>` block-opener style but left a multi-line hash literal and multi-line `case` expression inside the same ERB tag, which tripped Layout/FirstHashElementIndentation, Layout/IndentationConsistency, and the closing-newline-before-`%>` rule. Reshape: each assignment lives in its own single-line `<% %>` tag, and the per-provider sending-number lookup is a plain hash dispatch rather than a multi-line case. Same runtime behaviour; lint-clean. Co-Authored-By: Claude Opus 4.7 --- app/views/sms_settings/index.html.erb | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/app/views/sms_settings/index.html.erb b/app/views/sms_settings/index.html.erb index 3e430a51..592d6cc6 100644 --- a/app/views/sms_settings/index.html.erb +++ b/app/views/sms_settings/index.html.erb @@ -5,20 +5,10 @@ <% value = @encrypted_config.value || {} %> <% sms_live = Sms.enabled_for?(current_account) %> - <% provider_labels = { - 'bulkvs' => 'BulkVS', - 'twilio' => 'Twilio', - 'voipms' => 'VoIP.ms', - 'signalwire' => 'SignalWire' - } - sending_number = case value['provider'].to_s - when 'twilio' then value['twilio_from'] - when 'voipms' then value['voipms_did'] - when 'signalwire' then value['signalwire_from'] - else value['from_number'] - end - selected_provider = value['provider'].presence || 'bulkvs' - %> + <% provider_labels = { 'bulkvs' => 'BulkVS', 'twilio' => 'Twilio', 'voipms' => 'VoIP.ms', 'signalwire' => 'SignalWire' } %> + <% sending_number_keys = { 'twilio' => 'twilio_from', 'voipms' => 'voipms_did', 'signalwire' => 'signalwire_from' } %> + <% sending_number = value[sending_number_keys[value['provider'].to_s] || 'from_number'] %> + <% selected_provider = value['provider'].presence || 'bulkvs' %> <% if sms_live %>