adopted-ember-addons / adopted-ember-addons/ember-changeset-validations

Initial changset validation state

Open
#134 9 comments 5 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
215
Forks
98
PR merge metrics
No merged PRs in 30d

Description

Given a changeset reacts to changes, the default state is always valid until a change is made on each property.

Is there a way to force a validation to run on the entire changeset on construction?

e.g.
```
let model = {};

let validations = Ember.Object.create({
myKey: validatePresence(true)
});

let changeset = new Changeset(model, lookupValidator(validations), validations);
console.log(changeset.get('isValid')); // true, but the changeset is invalid

changeset.validate();
console.log(changeset.get('isValid')); // false, as expected
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.