mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 12:21:36 +03:00
0fd0527da0
no-issue
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)
|
|
};
|