From a02e49c0444230986fcbec5b31b71d6a189fb324 Mon Sep 17 00:00:00 2001 From: Wabo Date: Sun, 17 May 2026 13:12:50 -0400 Subject: [PATCH] Fix broken _account_logo partial after erblint autocorrect erblint's autocorrect on the prior commit stripped the opening <% tag from the variable-assignment block in app/views/shared/_account_logo.html.erb, leaving plain Ruby code as literal HTML and a NameError on every render. The "Failure/Error: <% if acc&.logo&.attached? %>" cascade in CI was 40+ specs hitting this partial via the navbar / start_form / submit_form / share-link QR / submission show paths. Restoring the proper <% ... %> tag. Also drop the now-redundant `# rubocop:disable Rails/Exit` comments in spec/rails_helper.rb (CI's rubocop-rails doesn't flag those lines) and add the same path to .rubocop.yml's Rails/Exit Exclude so the project's local rubocop agrees. Co-Authored-By: Claude Opus 4.7 --- .rubocop.yml | 4 ++++ app/views/shared/_account_logo.html.erb | 9 ++++----- spec/rails_helper.rb | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 0e332ff6..65898a22 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -24,6 +24,10 @@ Metrics/BlockLength: Style/Documentation: Enabled: false +Rails/Exit: + Exclude: + - spec/rails_helper.rb + Lint/MissingSuper: Enabled: false diff --git a/app/views/shared/_account_logo.html.erb b/app/views/shared/_account_logo.html.erb index 69895a79..69e7741e 100644 --- a/app/views/shared/_account_logo.html.erb +++ b/app/views/shared/_account_logo.html.erb @@ -4,11 +4,10 @@ class: CSS class string forwarded to / width: pixel width (default 37) height: pixel height (default 37) %> -acc = local_assigns[:account] - klass = local_assigns[:class] - w = local_assigns.fetch(:width, '37') - h = local_assigns.fetch(:height, '37') -%> +<% acc = local_assigns[:account] + klass = local_assigns[:class] + w = local_assigns.fetch(:width, '37') + h = local_assigns.fetch(:height, '37') %> <% if acc&.logo&.attached? %> <%= image_tag rails_blob_path(acc.logo, disposition: 'inline'), class: klass, diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index ab92db03..207b243f 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -4,7 +4,7 @@ require 'spec_helper' ENV['RAILS_ENV'] ||= 'test' ENV['TZ'] ||= 'UTC' require_relative '../config/environment' -abort('The Rails environment is running in production mode!') if Rails.env.production? # rubocop:disable Rails/Exit +abort('The Rails environment is running in production mode!') if Rails.env.production? require 'rspec/rails' require 'capybara/cuprite' require 'capybara/rspec' @@ -42,7 +42,7 @@ Rails.root.glob('spec/support/**/*.rb').each { |f| require f } begin ActiveRecord::Migration.maintain_test_schema! rescue ActiveRecord::PendingMigrationError => e - abort e.to_s.strip # rubocop:disable Rails/Exit + abort e.to_s.strip end RSpec.configure do |config|