mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
93fa9b4d9e
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
26 lines
665 B
JavaScript
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)
|
|
};
|