Add 'beforeCreate' hook in rest model

This commit is contained in:
Régis Hanol 2017-08-12 04:08:40 +02:00
parent 13e9d2867a
commit 962db8c759
1 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,7 @@ const RestModel = Ember.Object.extend({
isCreated: Ember.computed.equal('__state', 'created'),
isSaving: false,
beforeCreate() { },
afterUpdate() { },
update(props) {
@ -34,6 +35,8 @@ const RestModel = Ember.Object.extend({
props = props || this.createProperties();
this.beforeCreate(props);
const type = this.get('__type'),
store = this.get('store'),
adapter = store.adapterFor(type);