Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harmonize blank option #318

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

frykten
Copy link

@frykten frykten commented Oct 14, 2021

Hello!

This is linked to my proposal in #317 .

So I changed the allowBlank's check for the date validator to Ember's util isEmpty, as per the ones in the ember-validators (and therefore the ones in the other validators of this addon, since all but date use ember-validators).
However, while doing that, I saw that ember-validators does not use isEmpty for their dates (exceptionally) and instead make a custom check to only nullish values and empty strings (cf.). Maybe you would copy that, instead? I'm opening an issue on their side to ask them why this inconsistency.

Also, I updated the tests of the other addons to harmonize their checks and reflect the behaviours.

Comment on lines -8 to -10
if (options.allowBlank) {
options.allowNone = true;
}
Copy link
Author

Choose a reason for hiding this comment

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

I removed this one as it is not useful: isEmpty is basically isNone but with a larger scope, hence allowBlank has the same scope as allowNone but larger 🤷 (cf.)

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.

1 participant