2014-02-12 07:40:39 +04:00
|
|
|
var ghostBookshelf = require('./base'),
|
2014-02-25 00:28:18 +04:00
|
|
|
AppSetting = require('./appSetting'),
|
2014-02-12 07:40:39 +04:00
|
|
|
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');
|
2014-02-25 00:28:18 +04:00
|
|
|
},
|
|
|
|
|
|
|
|
settings: function () {
|
|
|
|
return this.belongsToMany(AppSetting, 'app_settings');
|
2014-02-12 07:40:39 +04:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
Apps = ghostBookshelf.Collection.extend({
|
|
|
|
model: App
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
App: App,
|
|
|
|
Apps: Apps
|
|
|
|
};
|