Ghost/core/server/models/email-recipient.js
Kevin Ansfield 93fa9b4d9e Removed unnecessary bookshelf-relations config in EmailRecipient model
no issue

- we don't use any of the `bookshelf-relations` plugin's added features for the `EmailRecipient` model so there's no need to opt in to it
2021-01-05 15:28:30 +00:00

26 lines
665 B
JavaScript

const ghostBookshelf = require('./base');
const EmailRecipient = ghostBookshelf.Model.extend({
tableName: 'email_recipients',
hasTimestamps: false,
email() {
return this.belongsTo('Email', 'email_id');
},
emailBatch() {
return this.belongsTo('EmailBatch', 'batch_id');
},
member() {
return this.belongsTo('Member', 'member_id');
}
});
const EmailRecipients = ghostBookshelf.Collection.extend({
model: EmailRecipient
});
module.exports = {
EmailRecipient: ghostBookshelf.model('EmailRecipient', EmailRecipient),
EmailRecipients: ghostBookshelf.collection('EmailRecipients', EmailRecipients)
};