Add 'beforeCreate' hook in rest model
This commit is contained in:
parent
13e9d2867a
commit
962db8c759
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue