mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-11 09:53:32 +03:00
5f5f0021db
no issue - support ends today - see https://github.com/nodejs/Release - removed `use strict`
28 lines
749 B
JavaScript
28 lines
749 B
JavaScript
const ghostBookshelf = require('./base'),
|
|
Basetoken = require('./base/token');
|
|
|
|
let Accesstoken,
|
|
Accesstokens;
|
|
|
|
Accesstoken = Basetoken.extend({
|
|
tableName: 'accesstokens',
|
|
|
|
emitChange: function emitChange(event, options) {
|
|
const eventToTrigger = 'token' + '.' + event;
|
|
ghostBookshelf.Model.prototype.emitChange.bind(this)(this, eventToTrigger, options);
|
|
},
|
|
|
|
onCreated: function onCreated(model, attrs, options) {
|
|
model.emitChange('added', options);
|
|
}
|
|
});
|
|
|
|
Accesstokens = ghostBookshelf.Collection.extend({
|
|
model: Accesstoken
|
|
});
|
|
|
|
module.exports = {
|
|
Accesstoken: ghostBookshelf.model('Accesstoken', Accesstoken),
|
|
Accesstokens: ghostBookshelf.collection('Accesstokens', Accesstokens)
|
|
};
|