Ghost/core/server/models/index.js

53 lines
737 B
JavaScript
Raw Normal View History

/**
* Dependencies
*/
var _ = require('lodash'),
exports,
models;
2013-06-01 18:47:41 +04:00
// enable event listeners
require('./base/listeners');
/**
* Expose all models
*/
exports = module.exports;
models = [
'accesstoken',
'app-field',
'app-setting',
'app',
'client-trusted-domain',
'client',
'permission',
'post',
'refreshtoken',
'role',
'settings',
'session',
'subscriber',
'tag',
'user',
'invite',
'webhook',
'integration',
'api-key',
'mobiledoc-revision'
];
function init() {
exports.Base = require('./base');
models.forEach(function (name) {
_.extend(exports, require('./' + name));
});
}
/**
* Expose `init`
*/
exports.init = init;