Conversation
口座参照中は ReferencedOnDisableValidator / ReferencedOnDeletionValidator で 無効化・削除を拒否する。一覧は従業員同型の無効→削除フローとし、編集画面では 営業店の disabled/deleted 操作と親無効時の UI 制御(状態「-」、追加不可)を行う。
Contributor
There was a problem hiding this comment.
Pull request overview
金融機関(Bank)および営業店(BankOffice)について、「参照中は無効化/削除を拒否する」ためのバリデーション追加と、mm/banks 画面を従業員同型の「無効→削除」フローに寄せる UI/ルーティング/コントローラ対応を行うPRです。
Changes:
- 無効化時の参照ガード(ReferencedOnDisableValidator)を追加し、Bank/BankOffice に適用
- BankOffice の削除参照ガードを追加し、関連するテスト・fixture を整備
- mm/banks に disable アクション/ルートを追加し、一覧・編集・表示UIを無効/削除フローに対応
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/models/validators/referenced_on_disable_validator_test.rb | 無効化ガードの新規テスト追加 |
| test/models/validators/referenced_on_deletion_validator_test.rb | BankOffice の削除ガードテスト追加、fixture参照へ移行 |
| test/fixtures/banks.yml | fixtureキーを用途別にリネーム |
| test/fixtures/bank_offices.yml | fixtureキーを用途別にリネーム |
| test/controllers/mm/banks_controller_test.rb | destroy/disable/参照ガードのコントローラテスト追加・更新 |
| config/routes/mm.rb | mm/banks に member disable ルート追加 |
| config/locales/hyacc.ja.yml | 銀行営業店関連のラベル追加 |
| app/views/mm/banks/index.html.erb | 一覧の操作を「無効」→「削除」へ分岐 |
| app/views/mm/banks/_show.html.erb | 親無効時の営業店「状態」表示制御等を追加 |
| app/views/mm/banks/_form.html.erb | Bankの状態編集/表示制御、partial引数を拡張 |
| app/views/mm/banks/_bank_offices_fields.html.erb | 親無効時の追加不可表示、削除列追加 |
| app/views/mm/banks/_bank_office_fields.html.erb | 親/子無効時の状態UI制御、deletedチェック追加 |
| app/utils/hyacc_errors.rb | Bank/BankOffice の無効化・削除エラーメッセージ定義を追加/更新 |
| app/models/validators/referenced_on_disable_validator.rb | 無効化時の参照チェックvalidatorを新規追加 |
| app/models/validators/referenced_on_deletion_validator.rb | BankOffice の削除参照チェックを追加 |
| app/models/bank.rb | 無効化validator適用、bank_offices関連に deleted: false スコープ追加 |
| app/models/bank_office.rb | 削除/無効化validator適用 |
| app/controllers/mm/banks_controller.rb | flash文言調整、destroyのredirect化、disable追加、nested params拡張 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
編集画面の状態項目と update での :disabled 受け付けを削除し、従業員マスタ同型にする。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
口座参照中は ReferencedOnDisableValidator / ReferencedOnDeletionValidator で 無効化・削除を拒否する。
一覧は従業員同型の無効→削除フローとし、編集画面では営業店の disabled/deleted 操作と親無効時の UI 制御(状態「-」、追加不可)を行う。