2013-07-27 19:41:10 +00:00
|
|
|
var migrations = require('../data/migration');
|
2013-06-01 10:47:41 -04:00
|
|
|
|
2013-06-25 12:43:15 +01:00
|
|
|
module.exports = {
|
|
|
|
Post: require('./post').Post,
|
|
|
|
User: require('./user').User,
|
|
|
|
Role: require('./role').Role,
|
|
|
|
Permission: require('./permission').Permission,
|
|
|
|
Settings: require('./settings').Settings,
|
2013-08-21 13:55:58 +01:00
|
|
|
Tag: require('./tag').Tag,
|
2013-06-25 12:43:15 +01:00
|
|
|
init: function () {
|
2013-07-27 19:41:10 +00:00
|
|
|
return migrations.init();
|
2013-08-03 16:11:16 +01:00
|
|
|
},
|
|
|
|
reset: function () {
|
|
|
|
return migrations.reset().then(function () {
|
|
|
|
return migrations.init();
|
|
|
|
});
|
2013-08-26 20:44:19 +01:00
|
|
|
},
|
|
|
|
isPost: function (jsonData) {
|
2013-09-11 23:04:49 +01:00
|
|
|
return jsonData.hasOwnProperty("html") && jsonData.hasOwnProperty("markdown")
|
2013-08-26 20:44:19 +01:00
|
|
|
&& jsonData.hasOwnProperty("title") && jsonData.hasOwnProperty("slug");
|
2013-06-25 12:43:15 +01:00
|
|
|
}
|
|
|
|
};
|