-
Notifications
You must be signed in to change notification settings - Fork 75
ペアワークをサポートする機能を実装 #8566
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?
ペアワークをサポートする機能を実装 #8566
Conversation
|
@machida ほとんどが既存のものを流用出来そうな作りだったので、出来る限り既存のものを流用する形で実装しています。 |
|
@mousu-a 了解です!連絡ありがとうございますー |
5d17011 to
8c0b692
Compare
|
@machida グローバルナビのQ&Aとペアワークのリンクを統合、了解です。 追加の機能を下記にまとめました。間違いがないかご確認いただければと思います🙏 追加したい機能
間違っていたらツッコミください! |
|
@mousu-a 確認しました!その認識でOKですー🙆 |
|
@mousu-a ただ、今回の分は先にマージをしたいです。 追加機能は省き、テストの追加、修正などを行ったらレビューに進めてください🙏 |
|
@machida |
aa84c72 to
aec1c26
Compare
|
@machida (CC: @komagata ) 1
ペアワーク機能は一時的に見えない状態でマージし、追加機能を実装後に見えるようにする、というこの方針ですが、追加機能を取り込むまでこのPR(ペアワーク機能)をマージしない というのではダメでしょうか? 理由としては、デザインの更新やQ&Aとの統合などもあり、単純にコメントアウトすれば良いというわけでもない箇所が多々あり、機能を見えない状態にするのもそうですが、戻す(見える状態にする)際もちょっと大変かなと思ったためです。 出来ないことはないですが、ちょっと作業量が膨大そうだったので先に相談させていただきました。ご検討いただければと思います🙏 2これはmachidaさんに向けた質問になりますが、このPR(ペアワーク機能)を先にマージしておきたいのは、そうしないとペアワーク機能のリリースまでにコンフリクトが溜まってしまうから、ということでしょうか? |
|
@mousu-a
そうですー |
|
@machida |
|
@mousu-a よろしくお願いしますー🙏 |
3eecb71 to
e356988
Compare
|
@komagata つい先日こちらを見つけました。 このPR内でもnewspaperを使っており、すでにPRの大部分の実装は終わっている状況です。 |
可能であればそのようにできればありがたいです〜 |
e356988 to
092481c
Compare
📝 WalkthroughWalkthroughペアワーク機能を新規追加。モデル、スケジュール、コントローラー、ビュー、ヘルパー、スタイル、マイグレーション、通知(メール/ノティファイア/ウォッチ)および関連テストが含まれます。 Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 分 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
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (2)app/**/*.rb📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.rb📄 CodeRabbit inference engine (AGENTS.md)
Files:
⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (38)📓 Common learnings📚 Learning: 2025-11-01T03:15:49.349ZApplied to files:
📚 Learning: 2025-07-01T04:30:19.565ZApplied to files:
📚 Learning: 2026-01-15T03:21:25.936ZApplied to files:
📚 Learning: 2025-07-01T04:26:24.636ZApplied to files:
📚 Learning: 2025-08-31T03:39:07.792ZApplied to files:
📚 Learning: 2025-09-22T03:12:23.411ZApplied to files:
📚 Learning: 2025-08-31T23:39:23.210ZApplied to files:
📚 Learning: 2026-01-11T04:41:41.597ZApplied to files:
📚 Learning: 2025-07-23T21:11:21.826ZApplied to files:
📚 Learning: 2025-09-12T21:16:47.639ZApplied to files:
📚 Learning: 2025-09-12T21:18:00.834ZApplied to files:
📚 Learning: 2025-09-01T22:31:57.345ZApplied to files:
📚 Learning: 2025-09-01T22:31:57.345ZApplied to files:
📚 Learning: 2025-07-15T12:33:04.885ZApplied to files:
📚 Learning: 2026-01-15T03:20:24.643ZApplied to files:
📚 Learning: 2025-09-04T01:27:23.422ZApplied to files:
📚 Learning: 2025-09-04T01:39:22.261ZApplied to files:
📚 Learning: 2025-07-23T21:11:21.826ZApplied to files:
📚 Learning: 2025-07-15T12:58:02.735ZApplied to files:
📚 Learning: 2025-08-31T12:08:33.904ZApplied to files:
📚 Learning: 2025-11-17T00:46:30.794ZApplied to files:
📚 Learning: 2025-06-29T03:44:15.179ZApplied to files:
📚 Learning: 2026-01-11T01:54:59.073ZApplied to files:
📚 Learning: 2025-09-04T01:50:47.773ZApplied to files:
📚 Learning: 2025-11-13T09:20:36.030ZApplied to files:
📚 Learning: 2025-12-03T06:39:24.048ZApplied to files:
📚 Learning: 2025-08-01T12:57:10.349ZApplied to files:
📚 Learning: 2025-08-28T00:34:28.541ZApplied to files:
📚 Learning: 2025-07-15T04:26:24.899ZApplied to files:
📚 Learning: 2025-07-07T12:46:01.650ZApplied to files:
📚 Learning: 2025-06-30T01:07:46.192ZApplied to files:
📚 Learning: 2025-07-26T15:24:14.799ZApplied to files:
📚 Learning: 2025-07-12T09:56:13.360ZApplied to files:
📚 Learning: 2025-08-22T02:25:18.706ZApplied to files:
📚 Learning: 2026-01-15T03:21:25.936ZApplied to files:
📚 Learning: 2026-01-15T03:20:24.643ZApplied to files:
📚 Learning: 2025-09-12T21:17:45.295ZApplied to files:
🪛 ast-grep (0.40.5)app/models/pair_work.rb[warning] 33-33: Found the use of an hardcoded passphrase for RSA. The passphrase can be easily discovered, and therefore should not be stored in source-code. It is recommended to remove the passphrase from source-code, and use system environment variables or a restricted configuration file. (hardcoded-secret-rsa-passphrase-ruby) ⏰ 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)
🔇 Additional comments (9)
✏️ Tip: You can disable this entire section by setting 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 |
092481c to
249f009
Compare
|
そこはis-hidden に変更でお願いします。最近の変更で、サイト全体でdisplay: none を使わず is-hidden を使うようにしましたー |
7464a11 to
afa957b
Compare
マジックナンバーの修正、変数の修正
indexと違ってN+1問題が発生しないため
cca63eb to
bcea6b3
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: 2
🤖 Fix all issues with AI agents
In `@app/models/pair_work.rb`:
- Around line 61-63: The ransackable_associations list in the PairWork model is
using the wrong association name; update the array returned by
self.ransackable_associations to include "schedules" (the association declared
by has_many :schedules) instead of "pair_work_schedules" so Ransack can find the
correct association.
In
`@db/migrate/20250519012857_add_not_null_constraint_to_pair_works_description.rb`:
- Around line 1-5: The migration AddNotNullConstraintToPairWorksDescription uses
change_column_null to set pair_works.description NOT NULL but doesn’t handle
existing NULLs; update the migration to either (a) set a safe default for
description and backfill any NULL rows before calling change_column_null, or (b)
replace change with explicit up/down methods where up first updates
pair_works.where(description: nil).update_all(description: '<default>') (or sets
a column default) then calls change_column_null, and down reverses the
default/nullability; ensure you reference
AddNotNullConstraintToPairWorksDescription, change_column_null, and the
pair_works.description column when making the change.
♻️ Duplicate comments (5)
app/javascript/stylesheets/application/blocks/event/_event-main-actions.sass (1)
10-12: 過去のレビューで対応済みとして確認されています。
:first-childの margin ルールについては、以前のレビューで議論され、対応済みとして確認されています。app/views/questions_and_pair_works/_questions_and_pair_works_header.html.slim (1)
1-30: 環境分岐の実装を確認しました過去のレビューで議論された通り、
Rails.env.production?による分岐は一時的な実装であり、Feature フラグ PR 完了後に削除予定であることを理解しています。TODO コメントも適切に記載されています。db/migrate/20250203011220_create_pair_works.rb (1)
1-16: LGTM!マイグレーションの設計は適切です。外部キー制約(
user,practice,buddy)が正しく定義されており、buddy_idのto_table: :users指定も正確です。過去のレビューで確認された通り、
wipカラムのデフォルト値は後続のマイグレーション(20250830033535_add_default_to_pair_works_wip.rb)でdefault: falseとして設定されています。app/views/activity_mailer/matching_pair_work.html.slim (1)
1-9: LGTM - テンプレート構造が適切です。既存のメールテンプレートパターンに沿った実装になっています。
md2htmlのXSS脆弱性については、過去のレビューで議論済みであり、別issueで対応予定とのことなので、本PRではこのままで問題ありません。db/schema.rb (1)
564-580: pair_worksテーブルの設計は適切以前のレビューで指摘された点が対応されています:
wipにdefault: falseが設定済みpublished_atにインデックスが追加済み外部キー(user_id, buddy_id → users, practice_id → practices)も適切に定義されています。
🧹 Nitpick comments (8)
app/javascript/stylesheets/application/blocks/event/_event-main-actions.sass (1)
63-68: ヘッダーとボディで同一のパディングルールが重複しています。
.event-main-actions__header(lines 35, 40-42)と同じパディングパターンが使用されています。将来的に共通のミックスインや extend で抽出することを検討できますが、現状のままでも問題ありません。app/models/watch_for_pair_work_creator.rb (1)
12-24:watch_recordsメソッドをprivateにすることを検討してください。このメソッドは
callメソッド内部でのみ使用されており、外部から呼び出される想定がないようです。PairWorkNotifierやPairWorkMatchingNotifierなど、同様のnotifierクラスではヘルパーメソッドをprivateにしています。♻️ 提案diff
end + private + def watch_records(pair_work) mentors = User.mentor.to_aapp/models/pair_work_callbacks.rb (1)
4-12: 条件分岐の簡略化を検討してください
ifとelsifの両方で同じ処理(ログ出力とキャッシュ削除)を実行しています。条件を||で結合することでコードの重複を減らせます。♻️ 提案するリファクタリング
def after_save(pair_work) - if pair_work.saved_change_to_attribute?(:published_at, from: nil) - Rails.logger.info '[CACHE CLEARED#after_save] Cache destroyed for unsolved pair work count.' - Cache.delete_not_solved_pair_work_count - elsif pair_work.saved_change_to_attribute?(:reserved_at) || pair_work.saved_change_to_attribute?(:wip) + if pair_work.saved_change_to_attribute?(:published_at, from: nil) || + pair_work.saved_change_to_attribute?(:reserved_at) || + pair_work.saved_change_to_attribute?(:wip) Rails.logger.info '[CACHE CLEARED#after_save] Cache destroyed for unsolved pair work count.' Cache.delete_not_solved_pair_work_count end endapp/views/questions_and_pair_works/_questions_and_pair_works_page_main_header.html.slim (1)
1-2: コメントスタイルの提案(任意)
//を使用するとHTMLコメントとしてレンダリングされます。本番リリース後に削除される一時的なコードであることを考慮すると問題はありませんが、出力に含めたくない場合は-#を使用してください。-// TODO ペアワークを本番リリースしたらこの分岐は削除 +-# TODO ペアワークを本番リリースしたらこの分岐は削除app/views/pair_works/_header.html.slim (1)
16-17: 軽微な一貫性の指摘:wipとwip?の混在Line 16では
pair_work.wip(属性直接参照)、Line 17ではpair_work.wip?(メソッド呼び出し)を使用しています。動作上は問題ありませんが、wip?に統一するとより一貫性が保たれます。♻️ 提案
- h1.page-content-header__title class=(pair_work.wip ? 'is-wip' : '') + h1.page-content-header__title class=(pair_work.wip? ? 'is-wip' : '')app/models/pair_work_schedule.rb (1)
5-6: バリデーションの統合を検討同じ属性に対する複数の
validates呼び出しを1行に統合できます。動作上は問題ありませんが、より簡潔な記述が可能です。♻️ 提案
- validates :proposed_at, presence: true - validates :proposed_at, uniqueness: { scope: :pair_work_id } + validates :proposed_at, presence: true, uniqueness: { scope: :pair_work_id }app/helpers/pair_work_helper.rb (1)
8-17:sorted_wdaysメソッドはより簡潔に書けます現在の実装は正しく動作しますが、Rubyのイディオムを使用するとより読みやすくなります。
♻️ リファクタリング案
def sorted_wdays(date) - max_wday = 6 - sorted_wdays = [date.wday] - max_wday.times do - next sorted_wdays << 0 if sorted_wdays.last == max_wday - - sorted_wdays << sorted_wdays.last + 1 - end - sorted_wdays + (0..6).map { |i| (date.wday + i) % 7 } endtest/system/pair_works_test.rb (1)
25-28: DOMセレクタが脆弱
#choices--js-choices-practice-item-choice-12のようなIDは、選択肢の順序やDOMの構造変更に依存します。より堅牢なテストのために、テキスト内容での検索を検討してください。within '.select-practices' do find('.choices__inner').click - find('#choices--js-choices-practice-item-choice-12', text: 'sshdでパスワード認証を禁止にする').click + find('.choices__item', text: 'sshdでパスワード認証を禁止にする').click end
| class AddNotNullConstraintToPairWorksDescription < ActiveRecord::Migration[6.1] | ||
| def change | ||
| change_column_null :pair_works, :description, false | ||
| end | ||
| end |
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.
🧩 Analysis chain
🏁 Script executed:
# Find when pair_works table was created
fd ".*migrate.*" db/migrate | xargs grep -l "create_table.*pair_works" | head -5Repository: fjordllc/bootcamp
Length of output: 43
🏁 Script executed:
# Check PairWork model for validations on description
fd "pair_work\.rb" app/models --exec cat {} \;Repository: fjordllc/bootcamp
Length of output: 3725
🏁 Script executed:
# Search for pair_works references to understand data initialization
rg "pair_works" --type ruby db/seeds.rb db/fixtures/ --max-count 20 2>/dev/null || echo "No seeds found"Repository: fjordllc/bootcamp
Length of output: 85
🏁 Script executed:
# Check the migration context - are there other migrations around this time?
ls -1 db/migrate/ | grep -E "202505" | head -10Repository: fjordllc/bootcamp
Length of output: 128
🏁 Script executed:
# Check when pair_works table was created
git log --oneline --all db/migrate | grep -i pair_works | head -10Repository: fjordllc/bootcamp
Length of output: 43
🏁 Script executed:
# Check the schema to understand pair_works table structure
rg "pair_works" db/schema.rb -A 10 -B 2Repository: fjordllc/bootcamp
Length of output: 2004
🏁 Script executed:
# Look for the creation migration of pair_works table
fd ".*migrate.*" db/migrate | xargs grep -l "create_table.*:pair_works" | head -1 | xargs catRepository: fjordllc/bootcamp
Length of output: 43
🏁 Script executed:
# Check seed data for pair_works initialization
rg "PairWork|pair_works" db/ --type ruby -g '*.rb' | grep -v migrate | head -20Repository: fjordllc/bootcamp
Length of output: 716
🏁 Script executed:
# Find the actual pair_works table creation migration
fd "migrate" db/migrate --type f | xargs grep -l "create_table.*:pair_works"Repository: fjordllc/bootcamp
Length of output: 45
🏁 Script executed:
# Read the pair_works table creation migration to see if description was already NOT NULL
fd "migrate" db/migrate --type f | xargs grep -l "create_table.*:pair_works" | xargs catRepository: fjordllc/bootcamp
Length of output: 43
🏁 Script executed:
# Check if there's a migration history showing the constraint change
git log --all --pretty=format:"%h %s" -- "db/migrate/*pair_works*description*" 2>/dev/null | head -20Repository: fjordllc/bootcamp
Length of output: 88
🏁 Script executed:
# Search all migrations for pair_works table creation and any column modifications
rg "pair_works" db/migrate/*.rb | rg -E "(create_table|change_column|add_column|remove_column)" | head -20Repository: fjordllc/bootcamp
Length of output: 457
🏁 Script executed:
# Find the initial pair_works table creation migration
ls -1 db/migrate/ | head -100 | tail -50 | while read f; do
if grep -q "create_table.*pair_works\|:pair_works" "db/migrate/$f" 2>/dev/null; then
echo "=== $f ==="
cat "db/migrate/$f" | head -30
fi
doneRepository: fjordllc/bootcamp
Length of output: 43
🏁 Script executed:
# Check if there's a migration that removed or modified the description column null constraint
rg "description" db/migrate/ -A 2 -B 2 | grep -E "(pair_works|change_column|remove_column|add_column)" | head -30Repository: fjordllc/bootcamp
Length of output: 2113
🏁 Script executed:
# Check the initial pair_works creation migration in full
cat db/migrate/20250203011220_create_pair_works.rbRepository: fjordllc/bootcamp
Length of output: 524
🏁 Script executed:
# Check if there are any other migrations that might have affected pair_works between creation and constraint
ls -1 db/migrate/202502* db/migrate/202503* db/migrate/202504* db/migrate/202505* 2>/dev/null | xargs grep -l "pair_works" | xargs catRepository: fjordllc/bootcamp
Length of output: 848
🏁 Script executed:
# Check the model to understand how pair_works are created - was description always required?
rg "validates.*description" app/models/pair_work.rbRepository: fjordllc/bootcamp
Length of output: 101
🏁 Script executed:
# Check if there are any fixtures or test data that might have NULL descriptions
rg "description" test/fixtures/pair_works.yml db/fixtures/ 2>/dev/null | head -10Repository: fjordllc/bootcamp
Length of output: 630
🏁 Script executed:
# Look for any migration that might have added the validation later
git log --all --oneline --follow -- app/models/pair_work.rb 2>/dev/null | head -5Repository: fjordllc/bootcamp
Length of output: 88
🏁 Script executed:
# Check when the validation was added to the model
git log --all -p --follow -- app/models/pair_work.rb 2>/dev/null | grep -A 5 -B 5 "validates :description" | head -30Repository: fjordllc/bootcamp
Length of output: 507
🏁 Script executed:
# Double-check: are there any pair_works records in production/staging that might have NULL description?
# Look for any data migration or cleanup scripts
rg "pair_works" db/ --type ruby | grep -i "update\|null\|delete" | head -10Repository: fjordllc/bootcamp
Length of output: 333
既存のNULL値がある場合、マイグレーションが失敗する可能性があります。
テーブル作成時(20250203)にdescription列はnullableで定義されていたため、もし既存レコードにNULLのdescriptionが存在する場合、このマイグレーションはデータベースエラーで失敗します。
ただし、pair_worksが本番環境にまだリリースされていない新機能の場合、この懸念は低くなります。より安全にするため、デフォルト値を指定するか、明示的なup/downメソッドでデータを先に更新することを検討してください。
♻️ 提案する修正
class AddNotNullConstraintToPairWorksDescription < ActiveRecord::Migration[6.1]
def change
- change_column_null :pair_works, :description, false
+ change_column_null :pair_works, :description, false, ''
end
endまたは、より明示的な方法:
class AddNotNullConstraintToPairWorksDescription < ActiveRecord::Migration[6.1]
- def change
- change_column_null :pair_works, :description, false
+ def up
+ PairWork.where(description: nil).update_all(description: '')
+ change_column_null :pair_works, :description, false
+ end
+
+ def down
+ change_column_null :pair_works, :description, true
end
end📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| class AddNotNullConstraintToPairWorksDescription < ActiveRecord::Migration[6.1] | |
| def change | |
| change_column_null :pair_works, :description, false | |
| end | |
| end | |
| class AddNotNullConstraintToPairWorksDescription < ActiveRecord::Migration[6.1] | |
| def change | |
| change_column_null :pair_works, :description, false, '' | |
| end | |
| end |
| class AddNotNullConstraintToPairWorksDescription < ActiveRecord::Migration[6.1] | |
| def change | |
| change_column_null :pair_works, :description, false | |
| end | |
| end | |
| class AddNotNullConstraintToPairWorksDescription < ActiveRecord::Migration[6.1] | |
| def up | |
| PairWork.where(description: nil).update_all(description: '') | |
| change_column_null :pair_works, :description, false | |
| end | |
| def down | |
| change_column_null :pair_works, :description, true | |
| end | |
| end |
🤖 Prompt for AI Agents
In
`@db/migrate/20250519012857_add_not_null_constraint_to_pair_works_description.rb`
around lines 1 - 5, The migration AddNotNullConstraintToPairWorksDescription
uses change_column_null to set pair_works.description NOT NULL but doesn’t
handle existing NULLs; update the migration to either (a) set a safe default for
description and backfill any NULL rows before calling change_column_null, or (b)
replace change with explicit up/down methods where up first updates
pair_works.where(description: nil).update_all(description: '<default>') (or sets
a column default) then calls change_column_null, and down reverses the
default/nullability; ensure you reference
AddNotNullConstraintToPairWorksDescription, change_column_null, and the
pair_works.description column when making the change.
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.
まだリリースされていないので問題はないと思います。
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.
@mousu-a さん、ご説明ありがとうございます。
まだ本番環境にリリースされていない新機能のマイグレーションであれば、既存レコードのバックフィル処理は不要ですね。開発環境ではrails db:resetが可能な状況ですし、この実装で問題ありません。
コンテキストをご説明いただき、ありがとうございました!
🧠 Learnings used
Learnt from: thmz337
Repo: fjordllc/bootcamp PR: 8857
File: db/migrate/20250624141527_remove_experience_from_users.rb:6-8
Timestamp: 2025-06-27T14:06:44.472Z
Learning: Railsのマイグレーションのdownメソッドでは、元のスキーマの正確な定義を確認してから制約を追加する必要がある。元のカラムに制約がない場合、ロールバック時に制約を追加すると元の状態と異なってしまう。
Learnt from: sharoa119
Repo: fjordllc/bootcamp PR: 8711
File: db/schema.rb:0-0
Timestamp: 2025-09-08T04:55:46.649Z
Learning: In this PR, the removal of length limits from companies.name and companies.website columns in db/schema.rb was unintentional - it was a case of accidentally lost constraints that needed to be restored to their original limits, not a deliberate design change.
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: db/migrate/20250830033535_add_default_to_pair_works_wip.rb:1-5
Timestamp: 2025-08-31T03:17:44.812Z
Learning: 新機能のマイグレーションで、まだ本番環境にリリースされていない場合は、既存レコードのバックフィル処理は不要。開発環境でrails db:resetが可能な状況では特に、デフォルト値の変更のみで十分。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
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を実行する慣例がある。
Learnt from: e-yanagita-gs
Repo: fjordllc/bootcamp PR: 8771
File: app/controllers/welcome_controller.rb:57-57
Timestamp: 2025-06-30T01:07:46.192Z
Learning: プロジェクトでは、仕様上データの存在が保証されている場合、nil処理を省略することがある。特にFAQ表示のような特定機能に特化した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/)を分離することで、より安全で管理しやすい構成を実現している。
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: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: test/mailers/activity_mailer_test.rb:0-0
Timestamp: 2025-08-01T12:57:10.349Z
Learning: came_pair_work機能は現在テスト運用段階で、メンターと関係者のみに通知される仕様のため、メール通知OFF時の制御テストは現時点では実装不要と判断されている。
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/views/application/_global_nav.slim:48-54
Timestamp: 2025-08-28T00:34:28.541Z
Learning: app/views/application/_global_nav.slim のQ&A/ペアワークバッジの環境分岐は、ペアワーク機能の本番リリース後に削除される一時的な実装である。その際、メンター・管理者のみに表示する制限仕様も撤廃される予定のため、現在の実装にはアクセス権限ガードを追加する必要がない。
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: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/controllers/pair_works_controller.rb:58-76
Timestamp: 2025-11-01T03:15:49.349Z
Learning: PairWork.matching_params?メソッドは、buddy_idとreserved_atのみを含むペア確定リクエストのみを許可するため、title、description、practice_id、channel、schedules_attributesがパラメータに含まれる場合は権限を拒否することで、メンターによる権限昇格を防ぐセキュリティ対策が実装されている。
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で対応すべきである。









Issue
概要
現在ディスコードで行っているペアプロ(ペアワーク)の募集、申し込みをbootcampアプリ上で行える機能を実装しました!
仕様をこちらのページにまとめています。
このPRでやること
このPRでやらないこと
titleやdescriptionなどは変更できますが、スケジュールは変更できないようになっています。このPRでやらないことに関してはこちらのissueで対応します。
変更確認方法
feature/support_pair_workをローカルに取り込むgit fetch origin feature/support_pair_workgit checkout feature/support_pair_workbin/devでローカルサーバーを立ち上げる。kimuraでログイン主な活動予定時間セクションにて、(月)3:00、(水)4:00、(木)3:00をチェックし、ページ下部の"更新する"ボタンをクリック
new-mentor、pjord,komagata,unadmentor,machidanohimitsu,mentormentaro)に通知が来ていることを確認komagataで再度ログイン(通知の確認もしたいためメンターが良いです)kimura)、メンター(敬称略:new-mentor、komagata,machidanohimitsu,mentormentaro,unadmentor,pjord)にペア確定の通知が来ていることを確認rails db:seedを実行し、kimuraで再ログイン、ダッシュボードにアクセスScreenshot
変更前
新機能なので変更前のスクリーンショットはありません!
変更後
一覧




詳細
詳細ペア確定後
近日開催のペアワーク
Summary by CodeRabbit
新機能
機能改善
スタイル
テスト
✏️ Tip: You can customize this high-level summary in your review settings.