2018-04-06 19:19:45 +03:00
|
|
|
const ghostBookshelf = require('./base'),
|
|
|
|
Basetoken = require('./base/token');
|
|
|
|
|
|
|
|
let Accesstoken,
|
2014-06-30 16:58:10 +04:00
|
|
|
Accesstokens;
|
|
|
|
|
2014-07-14 16:29:45 +04:00
|
|
|
Accesstoken = Basetoken.extend({
|
2016-06-01 19:46:41 +03:00
|
|
|
tableName: 'accesstokens',
|
|
|
|
|
2018-04-06 19:19:45 +03:00
|
|
|
emitChange: function emitChange(event, options) {
|
|
|
|
const eventToTrigger = 'token' + '.' + event;
|
|
|
|
ghostBookshelf.Model.prototype.emitChange.bind(this)(this, eventToTrigger, options);
|
2016-06-01 19:46:41 +03:00
|
|
|
},
|
|
|
|
|
2018-04-06 19:19:45 +03:00
|
|
|
onCreated: function onCreated(model, attrs, options) {
|
|
|
|
model.emitChange('added', options);
|
2016-06-01 19:46:41 +03:00
|
|
|
}
|
2014-06-30 16:58:10 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
Accesstokens = ghostBookshelf.Collection.extend({
|
|
|
|
model: Accesstoken
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = {
|
2014-07-13 15:17:18 +04:00
|
|
|
Accesstoken: ghostBookshelf.model('Accesstoken', Accesstoken),
|
|
|
|
Accesstokens: ghostBookshelf.collection('Accesstokens', Accesstokens)
|
2014-09-10 08:06:24 +04:00
|
|
|
};
|