mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 18:01:36 +03:00
9183c3fa11
refs https://github.com/TryGhost/Team/issues/1053 In order to use the model we must exports it from the index.js file. This was missing from the commit which added the models.
70 lines
1.2 KiB
JavaScript
70 lines
1.2 KiB
JavaScript
/**
|
|
* Dependencies
|
|
*/
|
|
|
|
const _ = require('lodash');
|
|
|
|
// enable event listeners
|
|
require('./base/listeners');
|
|
|
|
/**
|
|
* Expose all models
|
|
*/
|
|
exports = module.exports;
|
|
|
|
const models = [
|
|
'permission',
|
|
'post',
|
|
'role',
|
|
'settings',
|
|
'session',
|
|
'tag',
|
|
'tag-public',
|
|
'user',
|
|
'author',
|
|
'invite',
|
|
'webhook',
|
|
'integration',
|
|
'api-key',
|
|
'mobiledoc-revision',
|
|
'member',
|
|
'product',
|
|
'benefit',
|
|
'stripe-product',
|
|
'stripe-price',
|
|
'member-subscribe-event',
|
|
'member-paid-subscription-event',
|
|
'member-login-event',
|
|
'member-email-change-event',
|
|
'member-payment-event',
|
|
'member-status-event',
|
|
'member-product-event',
|
|
'member-analytic-event',
|
|
'posts-meta',
|
|
'member-stripe-customer',
|
|
'stripe-customer-subscription',
|
|
'email',
|
|
'email-batch',
|
|
'email-recipient',
|
|
'label',
|
|
'single-use-token',
|
|
'snippet',
|
|
// Action model MUST be loaded last as it loops through all of the registered models
|
|
// Please do not append items to this array.
|
|
'action'
|
|
];
|
|
|
|
function init() {
|
|
exports.Base = require('./base');
|
|
|
|
models.forEach(function (name) {
|
|
_.extend(exports, require('./' + name));
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Expose `init`
|
|
*/
|
|
|
|
exports.init = init;
|