Date validator does not respect 'rawOutput' option
dknutsen opened this issue · comments
Version
3.12.0
Steps to reproduce
- Configure rawOutput
- Create a date validator with one of the before, after, onOrBefore, onOrAfter options
- Run the validator against an invalid value
Expected Behavior
The Date validator should return a rawOutput object
Actual Behavior
The Date validator returns a single string message instead, e.g. [ON OR BEFORE] date is NOT on or before ${value}
Notes
I believe this behavior probably change in this PR. Passing context.message will return early at this line so it never hits the check for rawOutput.
Happy to attempt a PR though I'd have to dig in a little more to figure out what the best solve would be.
@dknutsen How does this look to you?
https://github.com/poteto/ember-changeset-validations/pull/288/files
@snewcomer left a comment about the message assertions but it looks great, thanks so much for the quick fix!