Ghost/core/server/models/index.js

23 lines
717 B
JavaScript
Raw Normal View History

var migrations = require('../data/migration');
2013-06-01 18:47:41 +04:00
module.exports = {
Post: require('./post').Post,
User: require('./user').User,
Role: require('./role').Role,
Permission: require('./permission').Permission,
Settings: require('./settings').Settings,
Tag: require('./tag').Tag,
init: function () {
return migrations.init();
},
reset: function () {
return migrations.reset().then(function () {
return migrations.init();
});
},
isPost: function (jsonData) {
return jsonData.hasOwnProperty("content") && jsonData.hasOwnProperty("content_raw")
&& jsonData.hasOwnProperty("title") && jsonData.hasOwnProperty("slug");
}
};