I have an Ember object that has as attribute a boolean field that I want to validate with ember-changeset-validations.
It is the typical "Agree to terms" checkbox.
Here is the hbs code:
{{one-way-checkbox changeset.agree_terms
class="form-control"
update=(action (mut changeset.agree_terms))}}
{{#each changeset.error.agree_terms.validation as |error|}}
<span class="text-danger help-block m-l-3">{{t (concat 'bookings.error.' error)}}</span>
{{/each}}
I have a validations file, where the particular validation for this member of changeset is:
agree_terms: validateFormat({
regex: /^(true)$/,
message: 'You need to agree on Terms!'
})
Thing is, for some reason this never validates to TRUE correctly, I always get the error message...any ideas what I'm doing wrong here?