mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 11:34:24 +03:00
c0dc8e95d2
closes #2325 - added new permissions - added relation to user roles - added updateFixtures to migrateUp - removed validation per model to fix tests
27 lines
584 B
JavaScript
27 lines
584 B
JavaScript
var ghostBookshelf = require('./base'),
|
|
AppSetting = require('./appSetting'),
|
|
App,
|
|
Apps;
|
|
|
|
App = ghostBookshelf.Model.extend({
|
|
tableName: 'apps',
|
|
|
|
permissions: function () {
|
|
// Have to use the require here because of circular dependencies
|
|
return this.belongsToMany(require('./permission').Permission, 'permissions_apps');
|
|
},
|
|
|
|
settings: function () {
|
|
return this.belongsToMany(AppSetting, 'app_settings');
|
|
}
|
|
});
|
|
|
|
Apps = ghostBookshelf.Collection.extend({
|
|
model: App
|
|
});
|
|
|
|
module.exports = {
|
|
App: App,
|
|
Apps: Apps
|
|
};
|