Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughRegularEventsコントローラーのAPIエンドポイントを削除し、その機能を従来型のRailsコントローラーに統合しました。React コンポーネントを削除して Rails ビューに置き換え、link-checker用のCloudBuild設定を追加し、複数のCSS更新を行いました。 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
bc497d5 to
0431823
Compare
c5b0cce to
ad05293
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@app/models/regular_event.rb`:
- Around line 160-167: Add unit tests for the new class method
RegularEvent.fetch_target_events to cover both branches: when target ==
'not_finished' it should call/return RegularEvent.not_finished (assert it
returns only not-finished records or that the scope is invoked), and for any
other target it should return RegularEvent.all; create tests in the model spec
(or corresponding test file) that set up sample RegularEvent records (finished
and not finished), call RegularEvent.fetch_target_events('not_finished') and
verify only not-finished records are returned, then call
RegularEvent.fetch_target_events('any_other') and verify all records are
returned or that RegularEvent.all is used.
🧹 Nitpick comments (2)
app/controllers/regular_events_controller.rb (1)
4-14:event.userのN+1を回避できているか確認してくださいビュー側で
event.userを参照しているため、with_avatarが:userを preload していない場合はN+1になります。with_avatarの挙動を確認し、必要ならincludes(:user)を追加してください。♻️ 追加する場合の例
- .includes(:comments, :users) + .includes(:comments, :users, :user)app/views/regular_events/_regular_events.html.slim (1)
1-8: タブの class 末尾の空白を除去すると読みやすいです
params[:target]が nil 以外の時に' 'を付けているので、不要な空白が残ります。空文字にすると意図が明確になります。✨ 例
- = link_to regular_events_path, class: "pill-nav__item-link#{params[:target].nil? ? ' is-active' : ' '}" do + = link_to regular_events_path, class: "pill-nav__item-link#{params[:target].nil? ? ' is-active' : ''}" do
|
@yokomaru こちら以前ミーティングでも話させていただいたのですが、コントローラー |
ad05293 to
638b193
Compare
|
@kutimiti1234 暫定対応として以下の形で進められればと思います。
class RegularEventsController < ApplicationController # rubocop:disable Metrics/ClassLength
|
|
@yokomaru |
95e94e2 to
7f032a8
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@app/views/regular_events/_regular_events.html.slim`:
- Around line 48-51: The time element's datetime attribute should be an ISO 8601
string; update the template so the datetime uses event.start_at.iso8601 (or
.utc.iso8601 if you want UTC) instead of passing the raw Time object (look for
the time.a-meta element and the datetime=event.start_at usage) to ensure valid
HTML and proper machine-readable timestamps.
611736f to
3690a6f
Compare
|
@yokomaru |
|
@kutimiti1234 |
|
@yokomaru |
|
@kutimiti1234 |
3690a6f to
57be93e
Compare
|
@yokomaru |
176fb46 to
eaad554
Compare
`test/system/regular_events_test.rb`の変更の詳細: `regular_events`は41個存在するので、1ページに25個表示された場合、2ページ目には16個表示されるはず。つまり、mainの既存実装が誤っている mainでテストが通過していたのは、現状はJSで実装されているため、JSが非同期で表示を切り替える前に、テストがplaceholder(8個のカードが存在する)の表示をassertしてしまい通過している
コントローラーのサイズが肥大化してしまったが、別issueで対応するため
kaminariのデフォルトpager_numberが25なので情報量が増えていないことから
7dfa6a3 to
4676806
Compare
|
@komagata |
Issue
概要
定期イベント一覧機能をReactから普通のrails viewに移行しました。
変更内容
app/controllers/regular_events_controller.rbでイベント一覧のデータ取得処理をするように修正app/javascript/components/RegularEvents.jsxはapp/views/regular_events/_regular_events.html.slimに移行。app/views/regular_events/index.html.slimで_regular_events.html.slimのrender処理を追加。変更確認方法
bin/devでアプリを起動する/regular_eventsへ遷移/regular_events/{id}に遷移すること/users/{id}に遷移すること/regular_events?target=not_finishedへ遷移Screenshot
画面の変更はありませんが、動作確認時の参考としてスクリーンショットを添付いたします。
Summary by CodeRabbit
リリースノート
新機能
削除
スタイル
その他