mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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'),
|
isCreated: Ember.computed.equal('__state', 'created'),
|
||||||
isSaving: false,
|
isSaving: false,
|
||||||
|
|
||||||
|
beforeCreate() { },
|
||||||
afterUpdate() { },
|
afterUpdate() { },
|
||||||
|
|
||||||
update(props) {
|
update(props) {
|
||||||
@ -34,6 +35,8 @@ const RestModel = Ember.Object.extend({
|
|||||||
|
|
||||||
props = props || this.createProperties();
|
props = props || this.createProperties();
|
||||||
|
|
||||||
|
this.beforeCreate(props);
|
||||||
|
|
||||||
const type = this.get('__type'),
|
const type = this.get('__type'),
|
||||||
store = this.get('store'),
|
store = this.get('store'),
|
||||||
adapter = store.adapterFor(type);
|
adapter = store.adapterFor(type);
|
||||||
|
Loading…
Reference in New Issue
Block a user