Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Deduplicate the registrant CSV row builder (events vs event_registrations exports)

オープン
#2,128 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
68/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
ruby
領域
backend

調査の方向性

app/controllers/events_controller.rb の EventsController#event_registration_csv_row と、app/controllers/event_registrations_controller.rb の Events::EventRegistrationsController#csv_export から始めます。両者のヘッダーと行のロジックを比較し、その後、共有 builder の形を決める前に、既存の controller CSV request spec を確認します。完了の条件は、両方の controller が builder を使用し、直接的な builder spec がそのオプションをカバーし、既存の CSV 出力が byte-for-byte で変更されていないことです。

索引モデルが issue の本文から書いたものです。

説明

enhancement event mgmt

🤖 From Claude: follow-up noted during the events-IA refactor (PR #2113); out of scope there.

Summary

Two controllers build essentially the same per-registrant CSV row from scratch:

  • EventsController#event_registration_csv_row (app/controllers/events_controller.rb, ~L876) — the per-event Manage roster export.
  • Events::EventRegistrationsController#csv_export (app/controllers/event_registrations_controller.rb, ~L365) — the cross-event registrations export.

Both emit the same columns — first name, last name, email, phone, org(s), scholarship (yes/no), scholarship completed, payment status, intends to pay, payment total, and CE status/paid/due — with only minor differences:

  • The cross-event export adds an Event column and uses attendance_status_label; the per-event one omits Event and gates payment on cost_required.
  • Org names: the per-event builder derives active-affiliation org names in Ruby; the cross-event one omits orgs.
  • CE columns are always present cross-event; conditional (include_ce) per-event.

They share csv_dollars, allocations_sum, scholarships.any?, payment_status_label, etc. — so the cell logic is duplicated and can drift (a change to how, say, scholarship-completed or CE-due is computed must be made in both).

Proposed approach

Extract a single row/column builder (e.g. an EventRegistrationCsvRow PORO or a shared concern) that takes an EventRegistration plus options (include_event_column:, include_ce:, cost_required:) and returns the header + row. Both controllers call it. Keep the two call sites' column-set differences as explicit options rather than divergent implementations.

Tasks

  • Extract the shared header + row builder.
  • Point both controllers at it (preserving each export's current columns exactly).
  • Spec the builder directly; keep the existing controller CSV request specs green (byte-for-byte output unchanged).

Out of scope

  • No new columns or format changes — pure dedup.
References
  • PR #2113 — the events-IA refactor that surfaced this.
主要言語
Ruby
スター
15
フォーク
28
平均マージ
1日 12分
マージ済み PR(30日)
262

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rubyforgood/awbw のほかの issue

rubyforgood/awbw の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。