Created
April 20, 2013 19:58
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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