You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The date validation has an option isBlank which is documented like so:
If true, skips validation if the value is empty
This accurately describes the implementation, which skips validation if isEmpty returns true for the value.
Other validators use allowBlank in combination with an isBlank check, and allowNone for an isEmpty check. This is inconsistent; blank should always mean blank, and empty/none should always mean empty.
There may be other validators with this problem, but I haven't checked.
Should this be fixed, and if so, how? One option is to deprecate the current allowBlank option in favor of allowNone, which would behave the same way. At the next major release, you could then add a real allowBlank option if desired.
The text was updated successfully, but these errors were encountered:
@bgentry you're right. There are definitely some inconsistencies here. What are your thoughts about instead using allowNone which will use Ember.isNone and allowEmpty which will use Ember.isEmpty? All of which can be defaulted to false and we can do a major version release.
The date validation has an option
isBlank
which is documented like so:This accurately describes the implementation, which skips validation if
isEmpty
returns true for the value.Other validators use
allowBlank
in combination with anisBlank
check, andallowNone
for anisEmpty
check. This is inconsistent; blank should always mean blank, and empty/none should always mean empty.There may be other validators with this problem, but I haven't checked.
Should this be fixed, and if so, how? One option is to deprecate the current
allowBlank
option in favor ofallowNone
, which would behave the same way. At the next major release, you could then add a realallowBlank
option if desired.The text was updated successfully, but these errors were encountered: