Ghost/core/server/models/index.js

48 lines
647 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',
'subscriber',
'tag',
'user',
'invite'
];
function init() {
exports.Base = require('./base');
models.forEach(function (name) {
_.extend(exports, require('./' + name));
});
}
/**
* Expose `init`
*/
exports.init = init;