Extract the events list UNION query out of EventsController
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 66/100
調査の方向性
Read EventsController and compare the existing app/queries/DashboardQuery and app/queries/SponsorsSearch patterns. Start with spec/controllers/events_controller_spec.rb and the feature specs touching the events pages; done means the controller has no Arel, behavior remains unchanged, and the specified specs pass.
索引モデルが issue の本文から書いたものです。
説明
Problem
EventsController builds the paginated upcoming/past events listing inside the controller: paginated_events (~80 lines) constructs a raw Arel UNION ALL across workshops, meetings, and events, plus a separate COUNT query and manual Pagy wiring, and load_events re-hydrates AR objects from the returned id/type pairs. fetch_upcoming_events and fetch_past_events are also near-duplicates of each other.
This is query logic, not HTTP coordination, and it makes the controller the largest non-admin one in the app. The repo already has app/queries/ (DashboardQuery, SponsorsSearch) — this work belongs there.
Proposed change
- Move the UNION ALL construction, count, pagination, and re-hydration into a single query class, e.g.
app/queries/events_feed_query.rb, with anupcoming:flag sofetch_upcoming_events/fetch_past_eventscollapse into one method. - Controller keeps only: parse
params[:page], call the query, assign for the view.
Acceptance
EventsController#upcoming/#pastare a few lines each and contain no Arel.- Existing behaviour unchanged: same ordering, grouping by date, 20 rows/page, DB-level count and pagination.
bundle exec rspec spec/controllers/events_controller_spec.rb(and the feature specs touching the events pages) pass.
- 主要言語
- Ruby
- スター
- 106
- フォーク
- 208
- 平均マージ
- 19時間 31分
- マージ済み PR(30日)
- 84
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codebar/planner のほかの issue
-
DashboardQuery eager-loads workshop_host with :sponsors in one join (same host-loss trap as #2975)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
Dual Invitiation issue対応中かも @mroderick が 3 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
codebar/planner#3008 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
codebar/planner の issue をすべて見る
似ている issue
-
Windows: packaged_agent_ruby? never matches 'Puppet Labs\Puppet', so the openvox gem is not foundオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
temporalio/sdk-ruby#625 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 94/100
zerocracy/judges-action#2803 ·
メンテナーはふだん 5 日以内に返信
-
empty tone.rbオープン
難易度 1/5 1時間未満 初心者へのやさしさ 78/100