lcoq / ember-validations

Ember-Validations - An Ember.js library for handling object validations
MIT License
122 stars 25 forks source link

dont assume that record is valid on createRecord() with no values passed #30

Closed ryrych closed 11 years ago

ryrych commented 11 years ago
item = @store.createRecord 'item'
# ...
item.get('isValid') # true
# item.save() #oops tries to save even if validation fails

# try to set isValid explicitly
item = @store.createRecord 'item'
item.set 'isValid', false

# now even validateProperty() passes, isValid on record is not updated