mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 13:52:10 +03:00
Added field defaults
This commit is contained in:
parent
ae14eb00f9
commit
0e822b4d54
@ -1,8 +1,16 @@
|
||||
const uuid = require('uuid');
|
||||
const ghostBookshelf = require('./base');
|
||||
|
||||
const Email = ghostBookshelf.Model.extend({
|
||||
tableName: 'emails',
|
||||
|
||||
defaults: function defaults() {
|
||||
return {
|
||||
uuid: uuid.v4(),
|
||||
status: 'sending'
|
||||
};
|
||||
},
|
||||
|
||||
emitChange: function emitChange(event, options) {
|
||||
const eventToTrigger = 'email' + '.' + event;
|
||||
ghostBookshelf.Model.prototype.emitChange.bind(this)(this, eventToTrigger, options);
|
||||
|
Loading…
Reference in New Issue
Block a user