adopted-ember-addons / adopted-ember-addons/ember-changeset
Solution for handling interdependent validations? ♻️
- 主要言語
- JavaScript
- スター
- 425
- フォーク
- 136
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
My team recently came across the need to validate a mutually dependent start and end date. The start date could not be before the end date and vice versa. It seems the changeset instance has no way to update the validations when a certain property changes. In this case, we needed to update the end date validation to account for a new start date and vice versa. We ended up having to directly modify the private `_validator` property on the changeset before each validation.
Did we miss something. Is there a better way to accomplish this task? Ideally it would be great if there were a public method for updating the validator as needed. Or, maybe one could specify a validation dependency which might then automatically update the validator as this respective property changes.
コントリビューションガイド
評価
この issue はまだ評価されていません。