Ghost/core/server/models/index.js
kirrg001 16fc0d29bf feature: when timezone changes, reschedule all posts
closes #6406
- created listeners.js connector
- merged listeners.js with events.js (in models/base)
- set a post to draft when published_at would be in the past
- reschedule a post when published_at would be in the future
2016-06-10 14:58:19 +02:00

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