Skip to content

Conversation

@y1220
Copy link

@y1220 y1220 commented Nov 8, 2025

Issue

概要

給付金対応コースのプラクティスページに元コースへのリンクを追加する。

変更確認方法

  1. source_idを既存のレコードに追加する。
  2. UIにてsource_idがある場合のみ、元プラクティス欄が表示される。
  3. リンクをクリックした際、source_idのプラクティスページが表示される。

Screenshot

image

Summary by CodeRabbit

リリースノート

  • 新機能
    • プラクティスに元プラクティスがある場合、それへのリンクを表示する機能を追加しました。プラクティス詳細画面に新しいカードが表示され、「元プラクティスを見る」ボタンからオリジナルのプラクティスにアクセスできます。

@coderabbitai
Copy link

coderabbitai bot commented Nov 8, 2025

ウォークスルー

プラクティス詳細ページに条件付きUIブロックを追加しました。@practice.source_idが存在する場合、「元プラクティス」というヘッダーと元プラクティスへのリンクボタンを含むカードを表示します。このブロックはコーディングテストセクションの後、管理者・メンターメモセクションの前に配置されています。

変更内容

コホート / ファイル 変更内容
プラクティス詳細ページのUI拡張
app/views/practices/show.html.slim
@practice.source_idが存在する場合に条件付きで表示される「元プラクティス」カードを追加。元プラクティスへのリンク機能を提供。

推定コードレビュー工数

🎯 1 (Trivial) | ⏱️ ~3分

  • 単一ファイルの変更で、条件付きUIレンダリングの追加のみ

関連の可能性があるイシュー

推奨レビュアー

  • komagata
  • tyrrell-IH
  • okuramasafumi

ポエム

🐰 元のプラクティスへの道を開きて
カードは優しく導きゆく
source_idの絆で繋がりて
ユーザーは歩む学びの旅路へ
条件付きの優雅な表現よ ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed プルリクエストのタイトルは、給付金対象コースのプラクティスページに元プラクティスへのリンクを追加するという変更の主要な目的を明確に要約しており、ファイル一覧や絵文字などのノイズがなく簡潔です。
Description check ✅ Passed プルリクエストの説明は、Issue番号、概要、変更確認方法、スクリーンショットを含み、テンプレートの必須セクションのほとんどをカバーしています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0c42e0d and 5041c04.

📒 Files selected for processing (1)
  • app/views/practices/show.html.slim (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common 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で対応すべきである。
🔇 Additional comments (1)
app/views/practices/show.html.slim (1)

127-137: 元プラクティスリンク実装は安全ですが、アプリケーション全体の認可設計を確認してください。

コード検証の結果:

  • 存在確認source_id が指す削除済みプラクティスには対応済み。dependent: :nullify により、元プラクティス削除時に自動的に source_idnull に設定されます。無効な ID の場合、Rails が 404 エラーを返すため問題ありません。

  • 認可制御:現在のアプリケーションにはプラクティスレベルの認可層が実装されていません。PracticesController の show アクションはログイン確認のみで、ユーザーは任意のプラクティスを閲覧可能です(すべてのプラクティスがパブリック)。

確認が必要な点
この設計(全プラクティスのパブリック公開)が意図的なものか、それとも認可レイヤーの欠落か確認してください。意図的な場合、本レビューコメントは対応不要です。


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant