Ghost/core/server/models/index.js
Fabien O'Carroll 4d9414b5d2 Created Session Model (#9909)
refs #9865

- Created session model for session table
- Added model relations
- Added unit test coverage
2018-09-27 14:31:39 +02:00

50 lines
677 B
JavaScript

/**
* Dependencies
*/
var _ = require('lodash'),
exports,
models;
// 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'
];
function init() {
exports.Base = require('./base');
models.forEach(function (name) {
_.extend(exports, require('./' + name));
});
}
/**
* Expose `init`
*/
exports.init = init;