Skip to content

提出物合格通知を「{メンター}が{提出物}を確認しました」から「{メンター}が{提出物}を合格にしました」に変更#9669

Merged
machida merged 6 commits intomainfrom
feature/trainee-submission-pass-notification-changed-from-checked-to-passed
Mar 9, 2026
Merged

提出物合格通知を「{メンター}が{提出物}を確認しました」から「{メンター}が{提出物}を合格にしました」に変更#9669
machida merged 6 commits intomainfrom
feature/trainee-submission-pass-notification-changed-from-checked-to-passed

Conversation

@y-kawahara-gs
Copy link
Contributor

@y-kawahara-gs y-kawahara-gs commented Feb 18, 2026

Issue

概要

研修生の提出物が合格になったときに、「{メンター}が{提出物}を確認しました」という通知の文言を「{メンター}が{提出物}を合格にしました」という文言に変更

変更確認方法

  1. feature/trainee-submission-pass-notification-changed-from-checked-to-passedをローカルに取り込む
  2. kensyu でログインする
  3. Terminalの基礎を覚えるにアクセスする
  4. 提出物を作るをクリックし、提出物に「Terminalの基礎を覚える」を入力(入力値はなんでもいい)し、提出する
  5. ログアウトし、komagata でログインする
  6. Terminalの基礎を覚えるの提出物にアクセスする
  7. 4で作成した提出物にアクセスし、提出物を合格にするをクリックする。
  8. kensyu で再度ログインし、通知から"komagata"さんが「Terminalの基礎を覚える」の提出物を合格にしました。"を確認する。
  9. メール通知にアクセスし、合格にされましたという文言になっていることを確認する。

Screenshot

変更前

  • アプリ内通知
    image

  • メール通知

image

変更後

  • アプリ内通知
    image

  • メール通知
    image

Summary by CodeRabbit

  • 通知メッセージの改善
    • 提出物の審査完了を示す表現を「確認」から条件に応じて「合格」に置き換えました(メール件名・本文、システム内通知、画面表示)。
  • テスト更新
    • 上記表現変更に合わせて通知・メール・システム通知のテスト期待値を更新しました。

@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

チェック文言を、チェック対象が Product の場合に「合格に」を用いるようにメーラー・ノーティファイア・ビュー・テストで一貫して文字列を変更しました。制御フローや公開APIの変更はありません。

Changes

Cohort / File(s) Summary
メーラー
app/mailers/activity_mailer.rb, app/mailers/notification_mailer.rb
checked メール件名で @check.action_label を使用し、対象が Product の場合は「合格に」を動的に挿入するよう変更。
テンプレート
app/views/activity_mailer/checked.html.slim
ビューで action_name を計算し、見出し・本文の文言を 合格に / 確認 に切替えるよう更新。
ノーティファイア
app/notifiers/activity_notifier.rb
通知本文で check.action_label を用いて「合格に」/「確認」を動的に切替える変更。
モデル
app/models/check.rb
Check#action_label メソッドを追加(Product のときは '合格に'、それ以外は '確認')。
テスト
test/deliveries/activity_delivery_test.rb, test/mailers/activity_mailer_test.rb, test/system/notification/products_test.rb
期待される件名・本文・通知文言のアサーションを 合格に に合わせて更新。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • okuramasafumi
  • komagata

Poem

🐰 ぴょんと変えた言葉ひとつ、合格に、
件名も本文もそろえてぴょんぴょん、
テストは頷き、小さな調整、
通知は跳ねて届くよ、
祝福を運ぶウサギより 🐇

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed プルリクエストのタイトルは、変更内容の主要なポイントを正確に反映しており、提出物合格通知の文言変更を明確に説明しています。
Description check ✅ Passed プルリクエストの説明は、テンプレートで要求されているすべての主要なセクション(Issue、概要、変更確認方法、Screenshot)を含み、詳細かつ完全です。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/trainee-submission-pass-notification-changed-from-checked-to-passed

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.

@y-kawahara-gs y-kawahara-gs self-assigned this Feb 18, 2026
@y-kawahara-gs y-kawahara-gs marked this pull request as ready for review February 19, 2026 02:07
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
test/deliveries/activity_delivery_test.rb (1)

21-21: .notify(:graduated) のフィクスチャメッセージが不適切に変更されています。

ActivityNotifier#graduated の本文は "🎉️ #{sender.login_name}さんが卒業しました!" ですが、このフィクスチャメッセージが「確認しました」→「合格にしました」に変更されており、卒業通知に「合格にしました」は意味的に無関係です。テストはデリバリー数のみを検証しているためテストは通過しますが、一括置換で意図せず変更されたと思われます。

🛠️ 修正案
-      message: "#{users(:kimura).login_name}さんがxxxxを合格にしました。",
+      message: "#{users(:kimura).login_name}さんが卒業しました!",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/deliveries/activity_delivery_test.rb` at line 21, フィクスチャの
`.notify(:graduated)` 用メッセージが誤って「合格にしました」になっているので、ActivityNotifier#graduated
の本文と一致する "🎉️ #{sender.login_name}さんが卒業しました!" に戻してください(該当のテストの fixture
メッセージ行、および users(:kimura) を参照している箇所を更新)。これにより通知種別 `.notify(:graduated)` と
ActivityNotifier#graduated の期待本文が整合します。
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@test/deliveries/activity_delivery_test.rb`:
- Line 21: フィクスチャの `.notify(:graduated)`
用メッセージが誤って「合格にしました」になっているので、ActivityNotifier#graduated の本文と一致する "🎉️
#{sender.login_name}さんが卒業しました!" に戻してください(該当のテストの fixture メッセージ行、および
users(:kimura) を参照している箇所を更新)。これにより通知種別 `.notify(:graduated)` と
ActivityNotifier#graduated の期待本文が整合します。

@y-kawahara-gs
Copy link
Contributor Author

y-kawahara-gs commented Feb 19, 2026

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Feb 19, 2026

✅ Actions performed

Full review triggered.

@y-kawahara-gs y-kawahara-gs force-pushed the feature/trainee-submission-pass-notification-changed-from-checked-to-passed branch from b47138b to 727acb7 Compare February 20, 2026 01:53
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
app/notifiers/activity_notifier.rb (1)

253-256: action_name変数名がRailsの組み込みメソッドと衝突する可能性 / DRY違反

変数名について

action_nameAbstractController::Base で定義されているRailsの組み込みメソッドです(ActionMailerのビューコンテキストでも利用可能)。ノーティファイアのコンテキストでは直接影響は小さいですが、action_labelcheck_action のようにより具体的な名前の方が意図が明確になります。

DRY違反について

同じ三項条件式 checkable_type == "Product" ? "合格に" : "確認" が少なくとも以下の3箇所に重複しています:

  • app/notifiers/activity_notifier.rb(Line 253)
  • app/views/activity_mailer/checked.html.slim(Line 1)
  • app/mailers/activity_mailer.rb(AIサマリーによる)

この判定ロジックを Check モデルにメソッドとして集約することで、将来的な変更を一箇所で管理できます。

♻️ Checkモデルへの抽出例

Check モデルに以下のメソッドを追加:

# app/models/check.rb
+  def action_label
+    checkable_type == "Product" ? "合格に" : "確認"
+  end

ノーティファイアでの使用:

-    action_name = check.checkable_type == "Product" ? "合格に" : "確認"
-
     notification(
-      body: "#{check.sender.login_name}さんが#{check.checkable.title}を#{action_name}しました。",
+      body: "#{check.sender.login_name}さんが#{check.checkable.title}を#{check.action_label}しました。",

ビューでの使用:

-  - action_name = `@check.checkable_type` == "Product" ? "合格に" : "確認"
+  - action_label = `@check.action_label`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/notifiers/activity_notifier.rb` around lines 253 - 256, 変数名 `action_name`
が Rails の組み込みメソッドと衝突する可能性と同じ三項条件式が複数箇所に重複しているので、三項判定 `check.checkable_type ==
"Product" ? "合格に" : "確認"` を Check モデルにメソッドとして抽出(例えば `action_label` または
`check_action` を追加)し、`app/notifiers/activity_notifier.rb` の該当箇所では `action_name`
を使わず `check.action_label` に置き換え、同様に
`app/views/activity_mailer/checked.html.slim` と `app/mailers/activity_mailer.rb`
で重複している判定をすべて `check.action_label` を呼ぶように変更してください。
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/notifiers/activity_notifier.rb`:
- Around line 253-256: 変数名 `action_name` が Rails
の組み込みメソッドと衝突する可能性と同じ三項条件式が複数箇所に重複しているので、三項判定 `check.checkable_type == "Product"
? "合格に" : "確認"` を Check モデルにメソッドとして抽出(例えば `action_label` または `check_action`
を追加)し、`app/notifiers/activity_notifier.rb` の該当箇所では `action_name` を使わず
`check.action_label` に置き換え、同様に `app/views/activity_mailer/checked.html.slim` と
`app/mailers/activity_mailer.rb` で重複している判定をすべて `check.action_label`
を呼ぶように変更してください。

@y-kawahara-gs
Copy link
Contributor Author

@matuaya
お疲れ様です!
レビューをお願いしたいです。
お忙しければ一報いただけますと助かります🙏

@matuaya
Copy link
Contributor

matuaya commented Feb 20, 2026

@y-kawahara-gs
お疲れ様です☺️
レビュー承りました!
数日ほどお時間いただける嬉しいです🙇‍♀️

Copy link
Contributor

@matuaya matuaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

動作バッチリだと思いました!
Approveさせていただきます☺️

@y-kawahara-gs
Copy link
Contributor Author

@okuramasafumi
お疲れ様です!メンバーレビュー完了したので、レビューをお願いします!

@@ -1,6 +1,6 @@
= render '/notification_mailer/notification_mailer_template',
title: "#{@check.checkable.title}が確認されました",
title: "#{@check.checkable.title}#{@check.action_label}されました",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「合格にされました」という日本語になることがありそうですが、確認済みでしたら大丈夫です!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@okuramasafumi さん
レビューありがとうございます!
文言について、@machidaさんと確認していなかったので、確認して修正します!

@machida machida merged commit b8b0570 into main Mar 9, 2026
12 checks passed
@machida machida deleted the feature/trainee-submission-pass-notification-changed-from-checked-to-passed branch March 9, 2026 00:43
@github-actions github-actions bot mentioned this pull request Mar 9, 2026
33 tasks
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.

4 participants