mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +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)
|
||
|
};
|