mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 18:52:14 +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)
|
||
|
};
|