mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-30 06:12:03 +03:00
d3f3b3dc20
refs #10124 - Author model returns only users that have published non-page posts - Added a public controller for tags (should be extracted to separate Content API controller https://github.com/TryGhost/Ghost/issues/10106) - Made resource configuration dynamic based on current theme engine - This needs a follow-up PR with fixes to the problems described in the PR
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)
|
|
};
|