mirror of
https://github.com/discourse/discourse.git
synced 2025-03-01 16:59:22 +00: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'),
|
||||
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…
x
Reference in New Issue
Block a user