ember-intl / cp-validations

ember-intl support for ember-cp-validations
MIT License
10 stars 13 forks source link

Incorrect placeholder variables used #7

Closed iivvoo closed 8 years ago

iivvoo commented 8 years ago

When using the following validation:

vat: validator('number', {
    allowBlank: false,
    allowString: true,
    gte: 0,
    lte: 1
}),

I get the following error when the value I enter is too large:

Uncaught Error: A value must be provided for: count

This is because the correct property is (for this specific error) {lte} since that is the relevant option in the validator, e.g.:

lessThanOrEqualTo: "{description} must be less than or equal to {lte}"

There's no {count} in this specific validation context. Same goes (probably) for lessThan ({lt}, greaterThan ({gt}), greaterThanOrEqualTo ({gte}), etc.

jasonmit commented 8 years ago

I'll do some digging to see what changed. Thanks for reporting it.

jasonmit commented 8 years ago

https://github.com/offirgolan/ember-cp-validations/commit/047590204fa36111005bc2395778a659393c15b3 introduced this but I've versioned a fix under ember-intl-cp-validations@2.1.4

I plan to keep the versions in lock step going forward to prevent confusion if a breaking change is introduced upstream.