-
Notifications
You must be signed in to change notification settings - Fork 75
曜日配列を rails-i18n を使用したコードに変更する #9338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughアプリ全体でハードコードされた曜日名/曜日配列を Rails I18n( Changes
Sequence Diagram(s)(該当なし) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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
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 |
9eea8eb to
ebbb79d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (2)
app/views/users/activity_times/_activity_time_tabs.html.slim (1)
8-13: ボタン表記もday_namesヘルパー経由に寄せると一貫しそうです現状、ドロップダウンボタンのラベルは
I18n.t('date.day_names')[clamp_day_index(@target_day_of_week)]、メニュー項目はday_names.each_with_indexと、曜日配列の取得経路が分かれています。どちらも同じ配列を意図しているなら、次のようにボタン側もday_namesを使うと、今後day_namesの実装を変えた際にも表示が揃いやすくなります(動作上は現状のままでも問題ありません)。- button.dropdown-button type="button" data-target="day-dropdown" - span.dropdown-button__text = I18n.t('date.day_names')[clamp_day_index(@target_day_of_week)] + button.dropdown-button type="button" data-target="day-dropdown" + span.dropdown-button__text = day_names[clamp_day_index(@target_day_of_week)]app/controllers/users/activity_times_controller.rb (1)
29-38:week_dayカラムと I18n ロケールの紐付きについてのメモ
week_day_name = I18n.t('date.abbr_day_names')[day_of_week.to_i]によって、learning_time_frames.week_dayには現在のI18n.localeのdate.abbr_day_names(現状はjaの「日〜土」)が保存されている/照会されている前提になります。アプリ全体を日本語ロケール固定で運用する前提であればこの実装で問題ありませんが、将来的にユーザーごとにロケールを切り替えたくなった場合、このクエリがヒットしなくなる可能性があります。そのときは例えば:
I18n.t('date.abbr_day_names', locale: I18n.default_locale)[day_of_week.to_i]のようにロケールを固定する- もしくは DB 側の
week_dayを整数(0〜6)に統一し、表示だけ I18n に任せるといった方向も検討できそうです。現時点では設計メモ・改善余地レベルの話なので、別 Issue/PR での対応でも良いと思います。
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
app/controllers/users/activity_times_controller.rb(1 hunks)app/decorators/regular_event_decorator.rb(1 hunks)app/helpers/activity_times_helper.rb(0 hunks)app/helpers/products_helper.rb(1 hunks)app/helpers/regular_events_helper.rb(1 hunks)app/helpers/users_helper.rb(0 hunks)app/models/regular_event.rb(0 hunks)app/notifiers/discord_notifier.rb(1 hunks)app/views/companies/products/_product.html.slim(7 hunks)app/views/regular_events/_regular_event_repeat_rule_fields.html.slim(1 hunks)app/views/users/_learning_time_frames.html.slim(1 hunks)app/views/users/activity_times/_activity_time_tabs.html.slim(1 hunks)app/views/users/activity_times/index.html.slim(1 hunks)app/views/users/form/_learning_time_frames.html.slim(1 hunks)test/helpers/activity_times_helper_test.rb(0 hunks)test/system/admin/campaigns_test.rb(0 hunks)test/system/mentor/survey_questions_test.rb(5 hunks)test/system/regular_events/participation_test.rb(2 hunks)
💤 Files with no reviewable changes (5)
- app/helpers/users_helper.rb
- test/system/admin/campaigns_test.rb
- test/helpers/activity_times_helper_test.rb
- app/models/regular_event.rb
- app/helpers/activity_times_helper.rb
🧰 Additional context used
📓 Path-based instructions (6)
app/**/*.{rb,js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Rails app code should be organized in
app/directory with subdirectories:models/,controllers/,views/,jobs/,helpers/, and frontend code underjavascript/(Shakapacker)
Files:
app/helpers/products_helper.rbapp/notifiers/discord_notifier.rbapp/helpers/regular_events_helper.rbapp/controllers/users/activity_times_controller.rbapp/decorators/regular_event_decorator.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
app/helpers/products_helper.rbtest/system/regular_events/participation_test.rbapp/notifiers/discord_notifier.rbtest/system/mentor/survey_questions_test.rbapp/helpers/regular_events_helper.rbapp/controllers/users/activity_times_controller.rbapp/decorators/regular_event_decorator.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
app/helpers/products_helper.rbtest/system/regular_events/participation_test.rbapp/notifiers/discord_notifier.rbtest/system/mentor/survey_questions_test.rbapp/helpers/regular_events_helper.rbapp/controllers/users/activity_times_controller.rbapp/decorators/regular_event_decorator.rb
**/*.slim
📄 CodeRabbit inference engine (AGENTS.md)
Slim templates should be linted according to
config/slim_lint.yml
Files:
app/views/users/activity_times/index.html.slimapp/views/users/_learning_time_frames.html.slimapp/views/regular_events/_regular_event_repeat_rule_fields.html.slimapp/views/users/activity_times/_activity_time_tabs.html.slimapp/views/users/form/_learning_time_frames.html.slimapp/views/companies/products/_product.html.slim
test/**/*_test.rb
📄 CodeRabbit inference engine (AGENTS.md)
test/**/*_test.rb: Test suite should use Minitest with structure:system/,models/,controllers/, and fixtures intest/fixtures/; test files should be named*_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matchingtest/*directories
Files:
test/system/regular_events/participation_test.rbtest/system/mentor/survey_questions_test.rb
test/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep tests deterministic and use fixtures stored in
test/fixtures/for test data
Files:
test/system/regular_events/participation_test.rbtest/system/mentor/survey_questions_test.rb
test/**/*
⚙️ CodeRabbit configuration file
test/**/*: # Test
- TestCase名は英語で書く。
- どうしても避けられない時以外にsystem testでsleepは使わない。
Unit Test
model, helper, decorator, view_componentについてはメソッドを追加した場合は必ず対応したUnit TestのTestCaseを1つは書く。
Files:
test/system/regular_events/participation_test.rbtest/system/mentor/survey_questions_test.rb
🧠 Learnings (3)
📓 Common learnings
Learnt from: hirokiej
Repo: fjordllc/bootcamp PR: 8740
File: app/helpers/reports_helper.rb:56-64
Timestamp: 2025-06-29T03:44:15.179Z
Learning: このプロジェクト(fjordllc/bootcamp)では、ja.ymlファイルで一部の単語や文章のみI18n対応されているが、多くのテキストは日本語でハードコーディングされており、完全な国際化対応は行われていない。新しい機能でもI18n対応は不要と判断される。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: jun-kondo
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-23T20:42:19.974Z
Learning: fjordllc/bootcampプロジェクトでは、hタグ(見出し)の文言は日本語でハードコーディングする方針が確立されており、I18n対応は行わない。例:app/views/welcome/logo.html.slimでh2、h3タグが日本語でハードコーディングされている。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
📚 Learning: 2025-08-31T23:39:23.210Z
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/views/pair_works/_body.html.slim:111-117
Timestamp: 2025-08-31T23:39:23.210Z
Learning: PairWorkモデルにreserved_at_in_schedules?カスタムバリデーション(on: :update)が実装されており、reserved_atが必ずschedules.map(&:proposed_at)に含まれることを検証している。これにより、フォームから任意の日時を送信することを防いでいる。
Applied to files:
test/system/regular_events/participation_test.rbapp/views/regular_events/_regular_event_repeat_rule_fields.html.slim
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
test/system/mentor/survey_questions_test.rb
🧬 Code graph analysis (5)
app/helpers/products_helper.rb (1)
test/system/mentor/survey_questions_test.rb (1)
t(5-94)
test/system/regular_events/participation_test.rb (1)
test/system/mentor/survey_questions_test.rb (1)
t(5-94)
app/notifiers/discord_notifier.rb (1)
test/system/mentor/survey_questions_test.rb (1)
t(5-94)
app/controllers/users/activity_times_controller.rb (1)
test/system/mentor/survey_questions_test.rb (1)
t(5-94)
app/decorators/regular_event_decorator.rb (1)
test/system/mentor/survey_questions_test.rb (1)
t(5-94)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (9)
app/notifiers/discord_notifier.rb (1)
69-69: LGTM!
I18n.t('date.abbr_day_names')[date.wday]への変更は適切です。date.wdayのインデックス(0=日曜日)とabbr_day_names配列の順序が一致しています。test/system/regular_events/participation_test.rb (2)
49-49: LGTM!I18n ベースの曜日名への変更は適切です。
date.day_namesを使用して完全な曜日名(例:「月曜日」)を取得しています。
59-59: LGTM!アサーションも I18n ベースの曜日名に一貫して変更されています。
app/views/regular_events/_regular_event_repeat_rule_fields.html.slim (1)
16-16: LGTM!
day_names_and_index_optionsヘルパーを使用することで、曜日オプションが I18n から動的に取得されるようになりました。app/views/users/form/_learning_time_frames.html.slim (1)
14-15: LGTM!テーブルヘッダーに
I18n.t('date.abbr_day_names')を使用することで、曜日の略称が I18n から取得されるようになりました。test/system/mentor/survey_questions_test.rb (1)
6-6: LGTM!クラスレベルで
DAYS_OF_THE_WEEK定数を定義し、I18n から曜日略称を取得するようにしたのは良い変更です。テスト全体で一貫して使用されています。app/helpers/regular_events_helper.rb (1)
3-6: LGTM!
day_names_and_index_optionsヘルパーは、select オプション用に[曜日名, インデックス]のペア配列を適切に生成しています。実装もシンプルで良いです。app/views/users/_learning_time_frames.html.slim (1)
10-11: I18n を使った曜日ヘッダへの置き換えは問題なさそうです
I18n.t('date.abbr_day_names')をそのままループに使う形になっており、ベタ書き配列が消えてメンテしやすくなっています。動作面で特に懸念はありません。app/decorators/regular_event_decorator.rb (1)
7-8:holding_day_of_the_weekの I18n 置き換えは妥当です
repeat_rule.day_of_the_weekが 0〜6 の整数であれば、I18n.t('date.day_names')[index]は従来のDAY_OF_THE_WEEK_LIST相当の「日曜日〜土曜日」を返すので、挙動は変えずに定義元だけを I18n に寄せられていると思います。
ebbb79d to
d4777dd
Compare
d4777dd to
cdc49a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
app/decorators/regular_event_decorator.rb (1)
7-7: 配列の範囲外アクセスに対する防御的なコーディングを検討してください。
repeat_rule.day_of_the_weekが 0-6 の範囲外の値である場合、I18n.t('date.day_names')[repeat_rule.day_of_the_week]はnilを返します。データベース制約で保護されていると思われますが、明示的なチェックを追加することでより堅牢になります。🔎 防御的なコードの提案
- holding_day_of_the_week = I18n.t('date.day_names')[repeat_rule.day_of_the_week] + day_names = I18n.t('date.day_names') + holding_day_of_the_week = day_names[repeat_rule.day_of_the_week] || day_names[0]app/helpers/products_helper.rb (1)
4-6: nil 入力に対する防御的なコーディングを検討してください。
dateがnilの場合、date.wdayはNoMethodErrorを発生させます。ビュー側でdateが常に存在することを保証している場合は問題ありませんが、明示的な nil チェックを追加することでより堅牢になります。🔎 nil ガードの提案
def abbr_day_name(date) + return '' if date.nil? I18n.t('date.abbr_day_names')[date.wday] end
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (20)
app/controllers/users/activity_times_controller.rb(1 hunks)app/decorators/regular_event_decorator.rb(1 hunks)app/helpers/activity_times_helper.rb(0 hunks)app/helpers/products_helper.rb(1 hunks)app/helpers/regular_events_helper.rb(1 hunks)app/helpers/users_helper.rb(0 hunks)app/models/regular_event.rb(0 hunks)app/notifiers/discord_notifier.rb(1 hunks)app/views/companies/products/_product.html.slim(7 hunks)app/views/regular_events/_regular_event_repeat_rule_fields.html.slim(1 hunks)app/views/users/_learning_time_frames.html.slim(1 hunks)app/views/users/activity_times/_activity_time_tabs.html.slim(1 hunks)app/views/users/activity_times/index.html.slim(1 hunks)app/views/users/form/_learning_time_frames.html.slim(1 hunks)test/helpers/activity_times_helper_test.rb(0 hunks)test/helpers/products_helper_test.rb(1 hunks)test/helpers/regular_events_helper_test.rb(1 hunks)test/system/admin/campaigns_test.rb(0 hunks)test/system/mentor/survey_questions_test.rb(5 hunks)test/system/regular_events/participation_test.rb(2 hunks)
💤 Files with no reviewable changes (5)
- test/helpers/activity_times_helper_test.rb
- app/helpers/activity_times_helper.rb
- test/system/admin/campaigns_test.rb
- app/models/regular_event.rb
- app/helpers/users_helper.rb
🚧 Files skipped from review as they are similar to previous changes (9)
- app/views/users/form/_learning_time_frames.html.slim
- app/views/regular_events/_regular_event_repeat_rule_fields.html.slim
- app/notifiers/discord_notifier.rb
- app/views/companies/products/_product.html.slim
- app/views/users/_learning_time_frames.html.slim
- test/system/mentor/survey_questions_test.rb
- app/views/users/activity_times/_activity_time_tabs.html.slim
- test/system/regular_events/participation_test.rb
- app/views/users/activity_times/index.html.slim
🧰 Additional context used
📓 Path-based instructions (5)
app/**/*.{rb,js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Rails app code should be organized in
app/directory with subdirectories:models/,controllers/,views/,jobs/,helpers/, and frontend code underjavascript/(Shakapacker)
Files:
app/decorators/regular_event_decorator.rbapp/helpers/regular_events_helper.rbapp/helpers/products_helper.rbapp/controllers/users/activity_times_controller.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
app/decorators/regular_event_decorator.rbapp/helpers/regular_events_helper.rbapp/helpers/products_helper.rbapp/controllers/users/activity_times_controller.rbtest/helpers/products_helper_test.rbtest/helpers/regular_events_helper_test.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
app/decorators/regular_event_decorator.rbapp/helpers/regular_events_helper.rbapp/helpers/products_helper.rbapp/controllers/users/activity_times_controller.rbtest/helpers/products_helper_test.rbtest/helpers/regular_events_helper_test.rb
test/**/*_test.rb
📄 CodeRabbit inference engine (AGENTS.md)
test/**/*_test.rb: Test suite should use Minitest with structure:system/,models/,controllers/, and fixtures intest/fixtures/; test files should be named*_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matchingtest/*directories
Files:
test/helpers/products_helper_test.rbtest/helpers/regular_events_helper_test.rb
test/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep tests deterministic and use fixtures stored in
test/fixtures/for test data
Files:
test/helpers/products_helper_test.rbtest/helpers/regular_events_helper_test.rb
test/**/*
⚙️ CodeRabbit configuration file
test/**/*: # Test
- TestCase名は英語で書く。
- どうしても避けられない時以外にsystem testでsleepは使わない。
Unit Test
model, helper, decorator, view_componentについてはメソッドを追加した場合は必ず対応したUnit TestのTestCaseを1つは書く。
Files:
test/helpers/products_helper_test.rbtest/helpers/regular_events_helper_test.rb
🧠 Learnings (9)
📓 Common learnings
Learnt from: hirokiej
Repo: fjordllc/bootcamp PR: 8740
File: app/helpers/reports_helper.rb:56-64
Timestamp: 2025-06-29T03:44:15.179Z
Learning: このプロジェクト(fjordllc/bootcamp)では、ja.ymlファイルで一部の単語や文章のみI18n対応されているが、多くのテキストは日本語でハードコーディングされており、完全な国際化対応は行われていない。新しい機能でもI18n対応は不要と判断される。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: jun-kondo
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-23T20:42:19.974Z
Learning: fjordllc/bootcampプロジェクトでは、hタグ(見出し)の文言は日本語でハードコーディングする方針が確立されており、I18n対応は行わない。例:app/views/welcome/logo.html.slimでh2、h3タグが日本語でハードコーディングされている。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
📚 Learning: 2025-09-12T21:18:00.834Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
app/helpers/products_helper.rb
📚 Learning: 2025-09-12T21:16:47.639Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
app/helpers/products_helper.rb
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
app/helpers/products_helper.rb
📚 Learning: 2025-09-12T21:17:45.295Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
app/helpers/products_helper.rb
📚 Learning: 2025-09-04T01:39:22.261Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Applied to files:
app/helpers/products_helper.rb
📚 Learning: 2025-09-01T22:31:57.345Z
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`はUnfinishedDataDestroyer(未チェックProduct・WIP Report削除、career_pathリセット)とTimesChannelDestroyer(Discord分報チャンネル削除)による重要なデータクリーンアップ処理を実行するため、退会のトリガーが何であろうと(admin、hibernation、user)必ず実行する必要がある。
Applied to files:
app/helpers/products_helper.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Test suite should use Minitest with structure: `system/`, `models/`, `controllers/`, and fixtures in `test/fixtures/`; test files should be named `*_test.rb`
Applied to files:
test/helpers/products_helper_test.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
test/helpers/products_helper_test.rbtest/helpers/regular_events_helper_test.rb
🧬 Code graph analysis (2)
test/helpers/products_helper_test.rb (1)
app/helpers/products_helper.rb (1)
abbr_day_name(4-6)
test/helpers/regular_events_helper_test.rb (1)
app/helpers/regular_events_helper.rb (1)
day_of_the_week_options_for_regular_event(4-6)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (2)
app/helpers/regular_events_helper.rb (1)
3-6: 実装が適切です。I18n を使用して曜日オプションを生成する実装は正しく、Rails の select オプション形式
[表示名, 値]に適合しています。with_indexの使用により、曜日の順序とインデックスが適切に対応付けられています。app/controllers/users/activity_times_controller.rb (1)
32-32: データベースの曜日形式との整合性を確認してください。
learning_time_frames.week_dayカラムに格納されている値が、I18n.t('date.abbr_day_names')から取得される略称形式('日', '月', '火' など)と一致していることを確認する必要があります。もし完全な曜日名('日曜日', '月曜日' など)や他の形式で保存されている場合、このクエリは期待通りに動作しません。以下のスクリプトで
learning_time_frames.week_dayに保存されている実際の値を確認してください:#!/bin/bash # Description: Check the actual values stored in learning_time_frames.week_day column rg -nP "week_day\s*[:=]" --type=rb -A2 -B2
cdc49a6 to
52ecbff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/views/companies/products/_product.html.slim (1)
29-29:lとI18n.lの使用が混在しています。Line 29 では
lヘルパーを使用し、Line 34 以降ではI18n.lを明示的に使用しています。機能的には同じですが、一貫性のためにどちらかに統一することを推奨します。🔎 統一案
.card-list-item-meta__item time.a-meta span.a-meta__label 提出 - | #{l product.published_at, format: :default_with_space} + | #{I18n.l(product.published_at, format: :default_with_space)}Also applies to: 34-34
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (17)
app/components/calendar/nico_nico_calendar_component.html.slimapp/controllers/users/activity_times_controller.rbapp/decorators/regular_event_decorator.rbapp/helpers/activity_times_helper.rbapp/helpers/users_helper.rbapp/models/regular_event.rbapp/notifiers/discord_notifier.rbapp/views/companies/products/_product.html.slimapp/views/regular_events/_regular_event_repeat_rule_fields.html.slimapp/views/users/_learning_time_frames.html.slimapp/views/users/activity_times/_activity_time_tabs.html.slimapp/views/users/activity_times/index.html.slimapp/views/users/form/_learning_time_frames.html.slimconfig/locales/ja.ymltest/helpers/activity_times_helper_test.rbtest/system/mentor/survey_questions_test.rbtest/system/regular_events/participation_test.rb
💤 Files with no reviewable changes (4)
- app/models/regular_event.rb
- app/helpers/users_helper.rb
- app/helpers/activity_times_helper.rb
- test/helpers/activity_times_helper_test.rb
🚧 Files skipped from review as they are similar to previous changes (8)
- app/views/regular_events/_regular_event_repeat_rule_fields.html.slim
- test/system/mentor/survey_questions_test.rb
- app/controllers/users/activity_times_controller.rb
- app/decorators/regular_event_decorator.rb
- app/views/users/activity_times/_activity_time_tabs.html.slim
- app/notifiers/discord_notifier.rb
- app/views/users/activity_times/index.html.slim
- app/views/users/_learning_time_frames.html.slim
🧰 Additional context used
📓 Path-based instructions (6)
**/*.slim
📄 CodeRabbit inference engine (AGENTS.md)
Slim templates should be linted according to
config/slim_lint.yml
Files:
app/components/calendar/nico_nico_calendar_component.html.slimapp/views/companies/products/_product.html.slimapp/views/users/form/_learning_time_frames.html.slim
config/**
📄 CodeRabbit inference engine (AGENTS.md)
Configuration files in
config/should include environment settings, routes, and lints (.rubocop.yml,config/slim_lint.yml)
Files:
config/locales/ja.yml
test/**/*_test.rb
📄 CodeRabbit inference engine (AGENTS.md)
test/**/*_test.rb: Test suite should use Minitest with structure:system/,models/,controllers/, and fixtures intest/fixtures/; test files should be named*_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matchingtest/*directories
Files:
test/system/regular_events/participation_test.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
test/system/regular_events/participation_test.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
test/system/regular_events/participation_test.rb
test/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep tests deterministic and use fixtures stored in
test/fixtures/for test data
Files:
test/system/regular_events/participation_test.rb
test/**/*
⚙️ CodeRabbit configuration file
test/**/*: # Test
- TestCase名は英語で書く。
- どうしても避けられない時以外にsystem testでsleepは使わない。
Unit Test
model, helper, decorator, view_componentについてはメソッドを追加した場合は必ず対応したUnit TestのTestCaseを1つは書く。
Files:
test/system/regular_events/participation_test.rb
🧠 Learnings (12)
📓 Common learnings
Learnt from: hirokiej
Repo: fjordllc/bootcamp PR: 8740
File: app/helpers/reports_helper.rb:56-64
Timestamp: 2025-06-29T03:44:15.179Z
Learning: このプロジェクト(fjordllc/bootcamp)では、ja.ymlファイルで一部の単語や文章のみI18n対応されているが、多くのテキストは日本語でハードコーディングされており、完全な国際化対応は行われていない。新しい機能でもI18n対応は不要と判断される。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: jun-kondo
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-23T20:42:19.974Z
Learning: fjordllc/bootcampプロジェクトでは、hタグ(見出し)の文言は日本語でハードコーディングする方針が確立されており、I18n対応は行わない。例:app/views/welcome/logo.html.slimでh2、h3タグが日本語でハードコーディングされている。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
📚 Learning: 2025-09-12T21:18:00.834Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-09-04T01:39:22.261Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-11-13T09:20:36.030Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-09-04T01:50:47.773Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-11-17T00:46:30.794Z
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 9306
File: app/javascript/components/Bookmarks.jsx:248-265
Timestamp: 2025-11-17T00:46:30.794Z
Learning: fjordllc/bootcamp プロジェクトでは、Reactからバニラ JavaScript への移行作業が進行中である。そのため、新しいReactファイルの作成は避け、既存のReactコンポーネント内で完結する実装が推奨される。BookmarksInDashboard.jsx は issue #9045 で削除予定。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-06-29T03:44:15.179Z
Learnt from: hirokiej
Repo: fjordllc/bootcamp PR: 8740
File: app/helpers/reports_helper.rb:56-64
Timestamp: 2025-06-29T03:44:15.179Z
Learning: このプロジェクト(fjordllc/bootcamp)では、ja.ymlファイルで一部の単語や文章のみI18n対応されているが、多くのテキストは日本語でハードコーディングされており、完全な国際化対応は行われていない。新しい機能でもI18n対応は不要と判断される。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-09-12T21:16:47.639Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-09-12T21:17:45.295Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-09-01T22:31:57.345Z
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`はUnfinishedDataDestroyer(未チェックProduct・WIP Report削除、career_pathリセット)とTimesChannelDestroyer(Discord分報チャンネル削除)による重要なデータクリーンアップ処理を実行するため、退会のトリガーが何であろうと(admin、hibernation、user)必ず実行する必要がある。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-08-31T23:39:23.210Z
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/views/pair_works/_body.html.slim:111-117
Timestamp: 2025-08-31T23:39:23.210Z
Learning: PairWorkモデルにreserved_at_in_schedules?カスタムバリデーション(on: :update)が実装されており、reserved_atが必ずschedules.map(&:proposed_at)に含まれることを検証している。これにより、フォームから任意の日時を送信することを防いでいる。
Applied to files:
test/system/regular_events/participation_test.rb
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (4)
config/locales/ja.yml (1)
24-26: LGTM!新しい時間フォーマットが適切に追加されています。
day_nameフォーマット(%A)は rails-i18n のフル曜日名(日曜日、月曜日など)を返し、default_with_spaceはビューでの日時表示に使用されています。app/views/users/form/_learning_time_frames.html.slim (1)
14-15: LGTM!ハードコードされていた曜日配列を
I18n.t('date.abbr_day_names')に置き換えており、PR の目的に沿った変更です。曜日のインデックス(日曜日 = 0)も正しく維持されています。test/system/regular_events/participation_test.rb (1)
49-49: LGTM!
I18n.l(now, format: :day_name)を使用して動的に曜日名を取得しています。これにより、テストがどの曜日に実行されても正しく動作し、ハードコードされた曜日配列への依存を排除しています。Also applies to: 59-59
app/components/calendar/nico_nico_calendar_component.html.slim (1)
26-30: LGTM!
I18n.t('date.abbr_day_names')を使用し、each_with_indexで曜日ヘッダーを動的に生成しています。日曜日(index 0)と土曜日(index 6)に適切なCSSクラスを付与するロジックも正しく実装されています。
e384b10 to
d02b80f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
test/system/admin/campaigns_test.rb (1)
136-137: コメントアウトされたコード内のI18n移行についてこれらの行は正しくI18n.lを使用するように更新されていますが、大きなテストブロック(119-171行目)全体がコメントアウトされているため、実際のテスト実行には影響しません。
コメントアウトされたコードを保守し続けるのは一般的に推奨されません。このテストを:
- 近い将来有効化する予定がある場合:そのままで問題ありません
- 削除すべき場合:コメントアウトされたコード全体を削除することを検討してください
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
app/components/calendar/nico_nico_calendar_component.html.slimapp/controllers/users/activity_times_controller.rbapp/decorators/regular_event_decorator.rbapp/helpers/activity_times_helper.rbapp/helpers/users_helper.rbapp/models/regular_event.rbapp/notifiers/discord_notifier.rbapp/views/companies/products/_product.html.slimapp/views/regular_events/_regular_event_repeat_rule_fields.html.slimapp/views/users/_learning_time_frames.html.slimapp/views/users/activity_times/_activity_time_tabs.html.slimapp/views/users/activity_times/index.html.slimapp/views/users/form/_learning_time_frames.html.slimconfig/locales/ja.ymltest/helpers/activity_times_helper_test.rbtest/system/admin/campaigns_test.rbtest/system/mentor/survey_questions_test.rbtest/system/regular_events/participation_test.rb
💤 Files with no reviewable changes (4)
- app/models/regular_event.rb
- test/helpers/activity_times_helper_test.rb
- app/helpers/activity_times_helper.rb
- app/helpers/users_helper.rb
🚧 Files skipped from review as they are similar to previous changes (11)
- app/views/users/_learning_time_frames.html.slim
- test/system/mentor/survey_questions_test.rb
- test/system/regular_events/participation_test.rb
- app/views/users/activity_times/index.html.slim
- app/views/users/form/_learning_time_frames.html.slim
- app/decorators/regular_event_decorator.rb
- app/controllers/users/activity_times_controller.rb
- app/notifiers/discord_notifier.rb
- config/locales/ja.yml
- app/components/calendar/nico_nico_calendar_component.html.slim
- app/views/users/activity_times/_activity_time_tabs.html.slim
🧰 Additional context used
📓 Path-based instructions (5)
**/*.slim
📄 CodeRabbit inference engine (AGENTS.md)
Slim templates should be linted according to
config/slim_lint.yml
Files:
app/views/regular_events/_regular_event_repeat_rule_fields.html.slimapp/views/companies/products/_product.html.slim
test/**/*_test.rb
📄 CodeRabbit inference engine (AGENTS.md)
test/**/*_test.rb: Test suite should use Minitest with structure:system/,models/,controllers/, and fixtures intest/fixtures/; test files should be named*_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matchingtest/*directories
Files:
test/system/admin/campaigns_test.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
test/system/admin/campaigns_test.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
test/system/admin/campaigns_test.rb
test/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep tests deterministic and use fixtures stored in
test/fixtures/for test data
Files:
test/system/admin/campaigns_test.rb
test/**/*
⚙️ CodeRabbit configuration file
test/**/*: # Test
- TestCase名は英語で書く。
- どうしても避けられない時以外にsystem testでsleepは使わない。
Unit Test
model, helper, decorator, view_componentについてはメソッドを追加した場合は必ず対応したUnit TestのTestCaseを1つは書く。
Files:
test/system/admin/campaigns_test.rb
🧠 Learnings (13)
📓 Common learnings
Learnt from: hirokiej
Repo: fjordllc/bootcamp PR: 8740
File: app/helpers/reports_helper.rb:56-64
Timestamp: 2025-06-29T03:44:15.179Z
Learning: このプロジェクト(fjordllc/bootcamp)では、ja.ymlファイルで一部の単語や文章のみI18n対応されているが、多くのテキストは日本語でハードコーディングされており、完全な国際化対応は行われていない。新しい機能でもI18n対応は不要と判断される。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: jun-kondo
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-23T20:42:19.974Z
Learning: fjordllc/bootcampプロジェクトでは、hタグ(見出し)の文言は日本語でハードコーディングする方針が確立されており、I18n対応は行わない。例:app/views/welcome/logo.html.slimでh2、h3タグが日本語でハードコーディングされている。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
📚 Learning: 2025-08-31T23:39:23.210Z
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/views/pair_works/_body.html.slim:111-117
Timestamp: 2025-08-31T23:39:23.210Z
Learning: PairWorkモデルにreserved_at_in_schedules?カスタムバリデーション(on: :update)が実装されており、reserved_atが必ずschedules.map(&:proposed_at)に含まれることを検証している。これにより、フォームから任意の日時を送信することを防いでいる。
Applied to files:
app/views/regular_events/_regular_event_repeat_rule_fields.html.slim
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
test/system/admin/campaigns_test.rb
📚 Learning: 2025-09-12T21:18:00.834Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-09-04T01:39:22.261Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-11-13T09:20:36.030Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-09-04T01:50:47.773Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-11-17T00:46:30.794Z
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 9306
File: app/javascript/components/Bookmarks.jsx:248-265
Timestamp: 2025-11-17T00:46:30.794Z
Learning: fjordllc/bootcamp プロジェクトでは、Reactからバニラ JavaScript への移行作業が進行中である。そのため、新しいReactファイルの作成は避け、既存のReactコンポーネント内で完結する実装が推奨される。BookmarksInDashboard.jsx は issue #9045 で削除予定。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-06-29T03:44:15.179Z
Learnt from: hirokiej
Repo: fjordllc/bootcamp PR: 8740
File: app/helpers/reports_helper.rb:56-64
Timestamp: 2025-06-29T03:44:15.179Z
Learning: このプロジェクト(fjordllc/bootcamp)では、ja.ymlファイルで一部の単語や文章のみI18n対応されているが、多くのテキストは日本語でハードコーディングされており、完全な国際化対応は行われていない。新しい機能でもI18n対応は不要と判断される。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-09-12T21:16:47.639Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-09-12T21:17:45.295Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-09-01T22:31:57.345Z
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`はUnfinishedDataDestroyer(未チェックProduct・WIP Report削除、career_pathリセット)とTimesChannelDestroyer(Discord分報チャンネル削除)による重要なデータクリーンアップ処理を実行するため、退会のトリガーが何であろうと(admin、hibernation、user)必ず実行する必要がある。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
app/views/companies/products/_product.html.slim
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (3)
app/views/companies/products/_product.html.slim (2)
62-77: LGTM! コメント日時の表示も統一されています。最終コメント日時(提出者・メンター)の表示も同様に I18n ベースのフォーマットに移行されており、一貫性が保たれています。条件分岐のロジックは維持されたまま、日時表示のみが改善されています。
29-39: I18nベースの日付フォーマット化が適切に実装されています。提出日時、作成日時、更新日時の表示を統一して
lヘルパーと:default_with_spaceフォーマットで処理する変更は、コードの保守性を向上させています。:default_with_spaceフォーマットには曜日情報が含まれており、表示される日付は「2025年 3月 15日 (土) 14:30」のような形式になります。app/views/regular_events/_regular_event_repeat_rule_fields.html.slim (1)
16-16:weekday_options_for_selectヘルパーメソッドが実装されていません。Line 16 で呼び出されている
weekday_options_for_selectヘルパーメソッドがコードベースに存在しません。このままではテンプレートがNoMethodErrorで失敗します。ヘルパーメソッドの実装が必要です。⛔ Skipped due to learnings
Learnt from: komagata Repo: fjordllc/bootcamp PR: 9101 File: app/notifiers/discord_notifier.rb:131-135 Timestamp: 2025-09-12T21:18:00.834Z Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。Learnt from: mousu-a Repo: fjordllc/bootcamp PR: 8566 File: app/views/pair_works/_body.html.slim:111-117 Timestamp: 2025-08-31T23:39:23.210Z Learning: PairWorkモデルにreserved_at_in_schedules?カスタムバリデーション(on: :update)が実装されており、reserved_atが必ずschedules.map(&:proposed_at)に含まれることを検証している。これにより、フォームから任意の日時を送信することを防いでいる。Learnt from: tyrrell-IH Repo: fjordllc/bootcamp PR: 8807 File: app/views/welcome/job_support.html.slim:391-392 Timestamp: 2025-06-21T22:30:20.116Z Learning: このプロジェクトにはRailsの組み込みmarkdownヘルパが利用できないため、markdownのHTML変換には自前でヘルパを実装する必要がある。
d02b80f to
20d48e7
Compare
- ドロップダウンはRails7から追加されたweekday_options_for_select helperを使用した
20d48e7 to
419ec48
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
test/system/regular_events/participation_test.rb (1)
47-47: テスト間の一貫性についてこのテストは現在の曜日を動的に使用するよう変更されましたが、最初のテストケース(Line 20)では依然として
'月曜日'がハードコードされています。すべてのテストケースで同じアプローチを使用することで、保守性が向上します。♻️ 一貫性のための提案
最初のテストケースも同様に動的な曜日選択に変更することを検討してください:
test 'create a regular event for all students and trainees' do now = Time.current visit_with_auth new_regular_event_path, 'komagata' within 'form[name=regular_event]' do fill_in 'regular_event[title]', with: '全員参加イベント' first('.choices__inner').click find('#choices--js-choices-multiple-select-item-choice-1').click first('.regular-event-repeat-rule').first('.regular-event-repeat-rule__frequency select').select('毎週') first('.regular-event-repeat-rule').first('.regular-event-repeat-rule__day-of-the-week select').select(I18n.l(now, format: :day_name)) # ... rest of test end click_button '作成' assert_text '定期イベントを作成しました。' assert_text "毎週#{I18n.l(now, format: :day_name)}" # ... endAlso applies to: 55-55
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
app/components/calendar/nico_nico_calendar_component.html.slimapp/controllers/users/activity_times_controller.rbapp/decorators/regular_event_decorator.rbapp/helpers/activity_times_helper.rbapp/helpers/users_helper.rbapp/models/regular_event.rbapp/notifiers/discord_notifier.rbapp/views/companies/products/_product.html.slimapp/views/regular_events/_regular_event_repeat_rule_fields.html.slimapp/views/users/_learning_time_frames.html.slimapp/views/users/activity_times/_activity_time_tabs.html.slimapp/views/users/activity_times/index.html.slimapp/views/users/form/_learning_time_frames.html.slimconfig/locales/ja.ymltest/helpers/activity_times_helper_test.rbtest/system/admin/campaigns_test.rbtest/system/mentor/survey_questions_test.rbtest/system/regular_events/participation_test.rb
💤 Files with no reviewable changes (4)
- app/helpers/users_helper.rb
- app/models/regular_event.rb
- app/helpers/activity_times_helper.rb
- test/helpers/activity_times_helper_test.rb
🚧 Files skipped from review as they are similar to previous changes (4)
- test/system/admin/campaigns_test.rb
- app/views/users/form/_learning_time_frames.html.slim
- config/locales/ja.yml
- app/components/calendar/nico_nico_calendar_component.html.slim
🧰 Additional context used
📓 Path-based instructions (6)
app/views/**/*.slim
📄 CodeRabbit inference engine (AGENTS.md)
Place Slim templates in
app/views/and ensure they are linted according toconfig/slim_lint.yml
Files:
app/views/companies/products/_product.html.slimapp/views/regular_events/_regular_event_repeat_rule_fields.html.slimapp/views/users/activity_times/index.html.slimapp/views/users/activity_times/_activity_time_tabs.html.slimapp/views/users/_learning_time_frames.html.slim
app/**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
app/**/*.rb: Place Rails app code inapp/directory with subdirectories formodels/,controllers/,views/,jobs/,helpers/, and frontend code underjavascript/
Follow Rails file naming conventions (e.g.,app/models/user.rb)
Files:
app/decorators/regular_event_decorator.rbapp/notifiers/discord_notifier.rbapp/controllers/users/activity_times_controller.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Use 2-space indent for Ruby code, snake_case for method names, and CamelCase for class names as enforced by RuboCop
Files:
app/decorators/regular_event_decorator.rbtest/system/mentor/survey_questions_test.rbapp/notifiers/discord_notifier.rbtest/system/regular_events/participation_test.rbapp/controllers/users/activity_times_controller.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
app/decorators/regular_event_decorator.rbtest/system/mentor/survey_questions_test.rbapp/notifiers/discord_notifier.rbtest/system/regular_events/participation_test.rbapp/controllers/users/activity_times_controller.rb
test/**/*_test.rb
📄 CodeRabbit inference engine (AGENTS.md)
Place unit and integration tests under matching
test/*directories with*_test.rbnaming convention
Files:
test/system/mentor/survey_questions_test.rbtest/system/regular_events/participation_test.rb
test/system/**/*_test.rb
📄 CodeRabbit inference engine (AGENTS.md)
Use Minitest + Capybara for system tests; place system tests in
test/system/directory
Files:
test/system/mentor/survey_questions_test.rbtest/system/regular_events/participation_test.rb
test/**/*
⚙️ CodeRabbit configuration file
test/**/*: # Test
- TestCase名は英語で書く。
- どうしても避けられない時以外にsystem testでsleepは使わない。
Unit Test
model, helper, decorator, view_componentについてはメソッドを追加した場合は必ず対応したUnit TestのTestCaseを1つは書く。
Files:
test/system/mentor/survey_questions_test.rbtest/system/regular_events/participation_test.rb
🧠 Learnings (13)
📓 Common learnings
Learnt from: hirokiej
Repo: fjordllc/bootcamp PR: 8740
File: app/helpers/reports_helper.rb:56-64
Timestamp: 2025-06-29T03:44:15.179Z
Learning: このプロジェクト(fjordllc/bootcamp)では、ja.ymlファイルで一部の単語や文章のみI18n対応されているが、多くのテキストは日本語でハードコーディングされており、完全な国際化対応は行われていない。新しい機能でもI18n対応は不要と判断される。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: jun-kondo
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-23T20:42:19.974Z
Learning: fjordllc/bootcampプロジェクトでは、hタグ(見出し)の文言は日本語でハードコーディングする方針が確立されており、I18n対応は行わない。例:app/views/welcome/logo.html.slimでh2、h3タグが日本語でハードコーディングされている。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
📚 Learning: 2025-09-12T21:18:00.834Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
app/views/companies/products/_product.html.slimapp/views/users/activity_times/index.html.slim
📚 Learning: 2025-09-04T01:39:22.261Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Applied to files:
app/views/companies/products/_product.html.slimapp/views/users/activity_times/index.html.slim
📚 Learning: 2025-11-13T09:20:36.030Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-09-04T01:50:47.773Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-11-17T00:46:30.794Z
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 9306
File: app/javascript/components/Bookmarks.jsx:248-265
Timestamp: 2025-11-17T00:46:30.794Z
Learning: fjordllc/bootcamp プロジェクトでは、Reactからバニラ JavaScript への移行作業が進行中である。そのため、新しいReactファイルの作成は避け、既存のReactコンポーネント内で完結する実装が推奨される。BookmarksInDashboard.jsx は issue #9045 で削除予定。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-06-29T03:44:15.179Z
Learnt from: hirokiej
Repo: fjordllc/bootcamp PR: 8740
File: app/helpers/reports_helper.rb:56-64
Timestamp: 2025-06-29T03:44:15.179Z
Learning: このプロジェクト(fjordllc/bootcamp)では、ja.ymlファイルで一部の単語や文章のみI18n対応されているが、多くのテキストは日本語でハードコーディングされており、完全な国際化対応は行われていない。新しい機能でもI18n対応は不要と判断される。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-09-12T21:16:47.639Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
app/views/companies/products/_product.html.slimapp/views/users/activity_times/index.html.slim
📚 Learning: 2025-09-12T21:17:45.295Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-09-01T22:31:57.345Z
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`はUnfinishedDataDestroyer(未チェックProduct・WIP Report削除、career_pathリセット)とTimesChannelDestroyer(Discord分報チャンネル削除)による重要なデータクリーンアップ処理を実行するため、退会のトリガーが何であろうと(admin、hibernation、user)必ず実行する必要がある。
Applied to files:
app/views/companies/products/_product.html.slimapp/views/users/activity_times/index.html.slim
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
app/views/companies/products/_product.html.slim
📚 Learning: 2025-08-31T23:39:23.210Z
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/views/pair_works/_body.html.slim:111-117
Timestamp: 2025-08-31T23:39:23.210Z
Learning: PairWorkモデルにreserved_at_in_schedules?カスタムバリデーション(on: :update)が実装されており、reserved_atが必ずschedules.map(&:proposed_at)に含まれることを検証している。これにより、フォームから任意の日時を送信することを防いでいる。
Applied to files:
app/views/regular_events/_regular_event_repeat_rule_fields.html.slimtest/system/regular_events/participation_test.rb
📚 Learning: 2026-01-08T21:12:18.350Z
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/controllers/pair_works_controller.rb:10-18
Timestamp: 2026-01-08T21:12:18.350Z
Learning: In fjordllc/bootcamp, when using ActiveRecord.order to specify ascending order, omit the explicit :asc and rely on Rails' default ASC behavior. Prefer .order(:published_at) over .order(published_at: :asc). If you need a non-default order (e.g., DESC), specify it explicitly. This guideline applies to Ruby/Rails controller and model files, especially in app/controllers and similar ActiveRecord usage sites.
Applied to files:
app/controllers/users/activity_times_controller.rb
🧬 Code graph analysis (1)
test/system/mentor/survey_questions_test.rb (1)
test/system/admin/campaigns_test.rb (1)
current(5-192)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (10)
app/decorators/regular_event_decorator.rb (1)
7-7: コードの簡潔化が適切です以前の
DAY_OF_THE_WEEK_LIST.findによる検索から、I18n による直接的な配列インデックスアクセスに変更されており、コードが大幅に簡潔になっています。Rails の標準的な I18n の使用方法に従っており、適切な変更です。app/views/regular_events/_regular_event_repeat_rule_fields.html.slim (1)
16-16: Rails 標準ヘルパーの使用で適切です
weekday_options_for_selectヘルパーの使用により、カスタム定数DAY_OF_THE_WEEK_LISTへの依存がなくなり、Rails の標準的な方法で曜日選択が実装されています。beginning_of_week: :sundayおよびindex_as_value: trueのパラメータは、元の動作(日曜日=0から始まるインデックス値)を正しく再現しています。app/views/users/_learning_time_frames.html.slim (1)
10-11: I18n による曜日表示への移行が適切ですローカル変数またはヘルパーメソッドから
I18n.t('date.abbr_day_names')への変更により、曜日の略称表示が統一的に I18n から取得されるようになりました。この変更は、プロジェクト全体の I18n への移行方針と一致しています。app/notifiers/discord_notifier.rb (1)
69-69: Discord 通知メッセージのフォーマットを確認してください
:mdwロケールフォーマットは'%m/%d %a'として定義されており、実際の出力は"05/05 金"のような形式になります(ゼロパディング付きの月日と空白区切り)。レビューで述べられている"12/3(月)"という形式(括弧付き、パディングなし)が意図している場合は、:mdw_uniqueフォーマット('%-m/%-d(%a)')の使用を検討してください。Likely an incorrect or invalid review comment.
app/views/companies/products/_product.html.slim (2)
29-29: 提出日時のフォーマットをI18n化複雑な日付コンポーネントの抽出と曜日配列の参照から、シンプルな
lヘルパーへの置き換えが適切に行われています。コードが大幅に簡潔になり、保守性が向上しています。Also applies to: 34-34, 39-39
62-62: コメントタイムスタンプのフォーマットをI18n化最終コメント日時の表示も同様にI18nベースのフォーマットに統一されており、一貫性が保たれています。
Also applies to: 67-67, 72-72, 77-77
app/views/users/activity_times/index.html.slim (1)
25-25: ページタイトルの曜日表示をI18n化ローカル変数からI18nへの置き換えが適切に行われています。
I18n.t('date.day_names')は完全な曜日名(「日曜日」「月曜日」など)の配列を返し、ページタイトルの表示に使用されています。app/views/users/activity_times/_activity_time_tabs.html.slim (1)
8-8: ドロップダウンの曜日表示をI18n化活動時間フィルターのドロップダウンにおいて、ハードコードされた曜日配列からI18nベースの表示に統一されています。選択中の曜日表示とドロップダウンオプションの両方で一貫してI18nを使用しており、適切な実装です。
Also applies to: 11-11
test/system/mentor/survey_questions_test.rb (1)
13-14: テストの日付フォーマットをI18n化複雑な
strftime呼び出しからI18n.l(Time.current, format: :long)へのシンプルな置き換えが行われており、テストの可読性が向上しています。:longフォーマットはconfig/locales/ja.ymlで'%Y年%m月%d日(%a)'として定義されており、日本語日付文字列(例:2025年1月15日(水))を正しく生成します。app/controllers/users/activity_times_controller.rb (1)
32-32: I18n を使用した曜日名の取得に統一
I18n.t('date.abbr_day_names')[day_of_week.to_i]による実装は適切です。rails-i18n によって提供される標準キーであり、返される配列(['日', '月', '火', '水', '木', '金', '土'])はlearning_time_frames.week_dayカラムが期待する値と一致しており、インデックス構造(0 始まり、日曜日から)も正しく対応しています。コードベース全体で同じパターンが使用されており(LearningTimeFrame モデル、TimeRangeHelper、複数のビュー)、一貫性があります。
| | #{product.published_at.year}年 | ||
| #{product.published_at.mon}月 | ||
| #{product.published_at.day}日 | ||
| (#{day_of_the_week[product.published_at.wday]}) | ||
| #{product.published_at.strftime('%R')} | ||
| | #{l product.published_at} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
企業別提出物ページの日付表示が、他の提出物ページ(http://localhost:3000/products) と異なり年や月の間にスペースが入っていました。町田さんに確認したところ意図しない表示(既存不具合)のようだったのでスペースが入らないように修正しています。
修正前
| # campaign_start = start_at.strftime("%-m/%-d(#{WEEK_DAY[start_at.wday]})") | ||
| # campaign_end = end_at.strftime("%-m/%-d(#{WEEK_DAY[end_at.wday]})") | ||
| # campaign_start = I18n.l(start_at, format: :mdw_unique) | ||
| # campaign_end = I18n.l(end_at, format: :mdw_unique) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
キャンペーンページのシステムテストは、ケースが細かすぎて失敗しやすくなっているため現在は一旦コメントアウトされているとのことでした(質問タイムで確認済み)。
今後不要なケースを削除したうえで復活させる予定とのことなので、コメントアウト内の曜日配列についても併せて対応しています。
念のため修正前後で文字列の値が変わっていないことは以下rails cで実行して確認しています。
WEEK_DAY = %w[日 月 火 水 木 金 土].freeze
start_at = Campaign.recently_campaign.first
end_at = Campaign.recently_campaign.last
before_campaign_start = start_at.strftime("%-m/%-d(#{WEEK_DAY[start_at.wday]})")
before_campaign_end = end_at.strftime("%-m/%-d(#{WEEK_DAY[end_at.wday]})")
campaign_start = I18n.l(start_at, format: :mdw_unique)
campaign_end = I18n.l(end_at, format: :mdw_unique)
before_campaign_start == campaign_start
#=> true
before_campaign_end == campaign_end
#=> true|
@tyrrell-IH |
|
@yokomaru |
|
引き受けてくださりありがとうございます!
上記承知いたしました〜!よろしくお願いします。 |


Issue
概要
I18nから取得するように変更する今回の対応範囲
%w[日 月 火 水 木 金 土]はI18n.t("date.abbr_day_names")に置き換え%w[日曜日 月曜日 火曜日 水曜日 木曜日 金曜日 土曜日]はI18n.t("date.day_names")に置き換えI18n.lを使用して日付フォーマットから表示するように修正weekday_options_for_selectを使用するように変更今回のPRでは対応せず別途対応する項目
data-属性としてi18nから渡したい #9504変更確認方法
前提
I18nに委譲するリファクタが中心のため、保存値に影響しうる箇所のみ手動で重点確認し、それ以外が表示が問題ないかどうかを簡単に確認するセットアップ
chore/use_i18n_to_display_the_days_of_the_weekをローカルに取り込むforeman start -f Procfile.devでサーバー起動定期イベント作成〜詳細〜編集
http://localhost:3000/regular_events/new検証項目
検証動画
2026-01-11.0.44.59.mov
主な活動予定時間の登録〜マイページの確認
URL:
http://localhost:3000/current_user/edit登録情報変更内の主な活動予定時間の登録
検証項目
マイページ
検証項目
検証動画
2026-01-11.0.46.40.mov
登録情報変更内の主な活動予定時間
マイページ
ニコニコカレンダー
URL:
http://localhost:3000/users/253826460検証項目
検証画像
ユーザー一覧:活動時間別
URL:
http://localhost:3000/users/activity_times検証項目
検証動画
2026-01-11.0.57.48.mov
企業別提出物一覧
URL:
http://localhost:3000/companies/1022975240/products検証項目
検証画像
その他確認
Discord通知
Notification::RegularEventsTest#notify_coming_soon_regular_events内でpayloadに含まれる今日/明日の開催の日付と曜日表記を検証しているためCIが通っていればOKbin/rails test test/system/notification/regular_events_test.rbテスト関連の修正
Screenshot
Summary by CodeRabbit
改善
削除
テスト
設定
✏️ Tip: You can customize this high-level summary in your review settings.