ea6c601b01
#closes #1655 - removed models as parameter for bookshelf-session - changed to read permittedAttributes from schema.js - changed updateTags to be executed at saved event - added validate to execute after saving event - added test for published_at = null (see #2015) - fixed typo in general.hbs
27 lines
551 B
JavaScript
27 lines
551 B
JavaScript
var ghostBookshelf = require('./base'),
|
|
|
|
Session,
|
|
Sessions;
|
|
|
|
Session = ghostBookshelf.Model.extend({
|
|
|
|
tableName: 'sessions'
|
|
|
|
}, {
|
|
destroyAll: function (options) {
|
|
options = options || {};
|
|
return ghostBookshelf.Collection.forge([], {model: this}).fetch().
|
|
then(function (collection) {
|
|
collection.invokeThen('destroy', options);
|
|
});
|
|
}
|
|
});
|
|
|
|
Sessions = ghostBookshelf.Collection.extend({
|
|
model: Session
|
|
});
|
|
|
|
module.exports = {
|
|
Session: Session,
|
|
Sessions: Sessions
|
|
}; |