mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
17 lines
422 B
JavaScript
17 lines
422 B
JavaScript
|
const customQueryPlug = function customQueryPlug(Bookshelf) {
|
||
|
const Model = Bookshelf.Model.extend({
|
||
|
// override this on the model itself
|
||
|
customQuery() {},
|
||
|
|
||
|
applyCustomQuery: function applyCustomQuery(options) {
|
||
|
this.query((qb) => {
|
||
|
this.customQuery(qb, options);
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
|
||
|
Bookshelf.Model = Model;
|
||
|
};
|
||
|
|
||
|
module.exports = customQueryPlug;
|