Skip to content

Instantly share code, notes, and snippets.

@superchris
Created April 20, 2013 19:58
Show Gist options
  • Save superchris/5427184 to your computer and use it in GitHub Desktop.
Save superchris/5427184 to your computer and use it in GitHub Desktop.
my lil hack of ember_data inflight state to make it compatible with ember-validations and ember-easyForm
becameInvalid: function(manager, errors) {
var record = get(manager, 'record');
if (get(record, 'errors')) {
for (prop in errors) {
set(record, "errors." + prop, errors[prop]);
}
} else {
set(record, 'errors', Ember.Object.create(errors));
}
manager.transitionTo('invalid');
manager.send('invokeLifecycleCallbacks');
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment