adopted-ember-addons / adopted-ember-addons/ember-changeset

Solution for handling interdependent validations? ♻️

オープン
#363 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
question
主要言語
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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。