0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-15 03:01:37 -05:00

Added defaults to member model

no-issue
This commit is contained in:
Fabien O'Carroll 2019-11-05 17:07:30 +07:00
parent a7e7f74f8b
commit 354e59a795

View file

@ -1,8 +1,16 @@
const ghostBookshelf = require('./base');
const uuid = require('uuid');
const Member = ghostBookshelf.Model.extend({
tableName: 'members',
defaults() {
return {
subscribed: true,
uuid: uuid.v4()
};
},
emitChange: function emitChange(event, options) {
const eventToTrigger = 'member' + '.' + event;
ghostBookshelf.Model.prototype.emitChange.bind(this)(this, eventToTrigger, options);