mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 17:32:15 +03:00
19 lines
414 B
JavaScript
19 lines
414 B
JavaScript
|
const ghostBookshelf = require('./base');
|
||
|
const user = require('./user');
|
||
|
|
||
|
const Author = user.User.extend({
|
||
|
shouldHavePosts: {
|
||
|
joinTo: 'author_id',
|
||
|
joinTable: 'posts_authors'
|
||
|
}
|
||
|
});
|
||
|
|
||
|
const Authors = ghostBookshelf.Collection.extend({
|
||
|
model: Author
|
||
|
});
|
||
|
|
||
|
module.exports = {
|
||
|
Author: ghostBookshelf.model('Author', Author),
|
||
|
Authors: ghostBookshelf.collection('Authors', Authors)
|
||
|
};
|