From 3438a62819b643d37d8a6c0ac7610d811325ecff Mon Sep 17 00:00:00 2001 From: Nat Budin Date: Thu, 9 Apr 2026 16:55:07 -0700 Subject: [PATCH 1/2] Fix NoMethodError for format_run_start_day in RunSignupsFilenameFinder (#11271) Move filename generators from a class-level constant into a private instance method so the lambdas close over self and can call instance methods. --- app/controllers/csv_exports_controller.rb | 28 +++++++++++-------- .../csv_exports_controller_test.rb | 26 +++++++++++++++++ 2 files changed, 42 insertions(+), 12 deletions(-) create mode 100644 test/controllers/csv_exports_controller_test.rb diff --git a/app/controllers/csv_exports_controller.rb b/app/controllers/csv_exports_controller.rb index cf63ce943cc..57741ec390a 100644 --- a/app/controllers/csv_exports_controller.rb +++ b/app/controllers/csv_exports_controller.rb @@ -1,17 +1,6 @@ # frozen_string_literal: true class CsvExportsController < ApplicationController class RunSignupsFilenameFinder - PRIORITIZED_FILENAME_GENERATORS = [ - ->(run) { run.event.title }, - ->(run) { "#{run.event.title} (#{run.title_suffix})" }, - ->(run) { "#{run.event.title} (#{format_run_start_day(run)})" }, - ->(run) { "#{run.event.title} (#{format_run_start_time(run)})" }, - ->(run) { "#{run.event.title} (#{format_run_rooms(run)})" }, - ->(run) { "#{run.event.title} (#{format_run_start_day(run)} in #{format_run_rooms(run)})" }, - ->(run) { "#{run.event.title} (#{format_run_start_time(run)} in #{format_run_rooms(run)})" }, - ->(run) { "#{run.event.title} (run #{run.id})" } - ].freeze - def format_run_start_day(run) run.starts_at.strftime("%a") end @@ -28,13 +17,28 @@ def format_run_rooms(run) # strategies def unique_filename(event, run, suffix) filename_generator = - PRIORITIZED_FILENAME_GENERATORS.find do |generator| + filename_generators.find do |generator| filenames = event.runs.map { |r| generator.call(r) } filenames.uniq.size == filenames.size end "#{filename_generator.call(run)} #{suffix}" end + + private + + def filename_generators # rubocop:disable Metrics/AbcSize + [ + ->(r) { r.event.title }, + ->(r) { "#{r.event.title} (#{r.title_suffix})" }, + ->(r) { "#{r.event.title} (#{format_run_start_day(r)})" }, + ->(r) { "#{r.event.title} (#{format_run_start_time(r)})" }, + ->(r) { "#{r.event.title} (#{format_run_rooms(r)})" }, + ->(r) { "#{r.event.title} (#{format_run_start_day(r)} in #{format_run_rooms(r)})" }, + ->(r) { "#{r.event.title} (#{format_run_start_time(r)} in #{format_run_rooms(r)})" }, + ->(r) { "#{r.event.title} (run #{r.id})" } + ] + end end include SendCsv diff --git a/test/controllers/csv_exports_controller_test.rb b/test/controllers/csv_exports_controller_test.rb new file mode 100644 index 00000000000..5104913a30e --- /dev/null +++ b/test/controllers/csv_exports_controller_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +require "test_helper" + +describe CsvExportsController::RunSignupsFilenameFinder do + let(:finder) { CsvExportsController::RunSignupsFilenameFinder.new } + let(:convention) { create(:convention) } + let(:event) { create(:event, convention: convention) } + + describe "#unique_filename" do + it "disambiguates runs by start day when they share a title" do + run1 = create(:run, event: event, starts_at: convention.starts_at) + create(:run, event: event, starts_at: convention.starts_at + 1.day) + + assert_equal( + "#{event.title} (#{run1.starts_at.strftime("%a")}) Signups", + finder.unique_filename(event, run1, "Signups") + ) + end + + it "uses just the event title when the event has only one run" do + run = create(:run, event: event, starts_at: convention.starts_at) + + assert_equal "#{event.title} Signups", finder.unique_filename(event, run, "Signups") + end + end +end From e5bbd7c55f8d120581dee109651b68bd776eed8e Mon Sep 17 00:00:00 2001 From: Nat Budin Date: Thu, 9 Apr 2026 16:58:33 -0700 Subject: [PATCH 2/2] Add co-author and generated-by lines to fix-issue skill Co-Authored-By: Claude Sonnet 4.6 --- .claude/commands/fix-issue.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.claude/commands/fix-issue.md b/.claude/commands/fix-issue.md index 85c1617130a..637ed163338 100644 --- a/.claude/commands/fix-issue.md +++ b/.claude/commands/fix-issue.md @@ -48,6 +48,10 @@ Before writing any code: - Stage all changes with `git add` - Write a concise, descriptive commit message referencing the issue (e.g. `Fix login bug (#1234)`) +- The commit message must end with a co-author line: + ``` + Co-Authored-By: Claude Sonnet 4.6 + ``` - Commit the changes ## Step 7: Open a PR @@ -56,6 +60,7 @@ Before writing any code: 2. Create a PR with `gh pr create`: - Title should summarize the fix - Body should reference the issue (`Fixes #`) and briefly describe what changed + - Body must end with: `🤖 Generated with [Claude Code](https://claude.com/claude-code)` 3. Add labels using the GitHub REST API (required — gh pr edit is broken): ```