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

Can't overwrite validate.validators.numericality.options.message #145

Closed
nitriques opened this Issue Jul 22, 2016 · 7 comments

Comments

Projects
None yet
2 participants
@nitriques

nitriques commented Jul 22, 2016

if I set a value to validate.validators.numericality.options.message, you can't customize the message when validating, using message or notValid. I would expect to still be able to provide custom messages event if I set a default one. This problem looks specific to the numericality validator, as I do not have this problem with the 'presence' validator.

I've tried to set the message in both the constraints and option object, without any luck

This is using the validate.single function.

@nitriques

This comment has been minimized.

Show comment
Hide comment
@nitriques

nitriques Jul 22, 2016

Here's a fiddle with the P.O.C

https://jsfiddle.net/nitriques/4d9p3ju9/3/

As if you remove all other properties except message in the constraint, overwriting works. But if you add onlyInteger or greaterThan, it stops working.

nitriques commented Jul 22, 2016

Here's a fiddle with the P.O.C

https://jsfiddle.net/nitriques/4d9p3ju9/3/

As if you remove all other properties except message in the constraint, overwriting works. But if you add onlyInteger or greaterThan, it stops working.

@nitriques

This comment has been minimized.

Show comment
Hide comment
@nitriques

nitriques Jul 22, 2016

The fiddle is using the edge version

nitriques commented Jul 22, 2016

The fiddle is using the edge version

@ansman

This comment has been minimized.

Show comment
Hide comment
@ansman

ansman Aug 9, 2016

Owner

This is definitely a bug, nice catch.

Owner

ansman commented Aug 9, 2016

This is definitely a bug, nice catch.

@ansman ansman added the bug label Aug 9, 2016

@ansman ansman added this to the Next milestone Aug 9, 2016

@ansman ansman closed this in 2ad92f5 Aug 9, 2016

@ansman

This comment has been minimized.

Show comment
Hide comment
@ansman

ansman Aug 9, 2016

Owner

Using the edge version you can now set validate.validators.numericality.message (note that you don't set the options, just the message)

Owner

ansman commented Aug 9, 2016

Using the edge version you can now set validate.validators.numericality.message (note that you don't set the options, just the message)

@nitriques

This comment has been minimized.

Show comment
Hide comment
@nitriques

nitriques Aug 26, 2016

Hum my fiddle still does not works... I am missing something ?

nitriques commented Aug 26, 2016

Hum my fiddle still does not works... I am missing something ?

@ansman

This comment has been minimized.

Show comment
Hide comment
@ansman

ansman Nov 5, 2016

Owner

Released in 0.11.0

Owner

ansman commented Nov 5, 2016

Released in 0.11.0

@nitriques

This comment has been minimized.

Show comment
Hide comment
@nitriques

nitriques commented Nov 17, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment