poteto / ember-changeset-validations

Validations for ember-changeset

Home Page:http://bit.ly/ember-changeset-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Date validator does not respect 'rawOutput' option

dknutsen opened this issue · comments

Version

3.12.0

Steps to reproduce

  1. Configure rawOutput
  2. Create a date validator with one of the before, after, onOrBefore, onOrAfter options
  3. 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.

@snewcomer left a comment about the message assertions but it looks great, thanks so much for the quick fix!