mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 16:01:40 +03:00
26 lines
660 B
JavaScript
26 lines
660 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.model('EmailRecipients', EmailRecipients)
|
||
|
};
|