mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Moved defaultColumnsToFetch
to Bookshelf CRUD plugin
no issue - the CRUD plugin uses this function so we want to keep similar things together to make it easier to test in the future
This commit is contained in:
parent
0830bcb74e
commit
a457631a20
2 changed files with 5 additions and 5 deletions
|
@ -33,11 +33,6 @@ ghostBookshelf.Model = ghostBookshelf.Model.extend({
|
|||
.filter(key => key.indexOf('@@') === -1);
|
||||
},
|
||||
|
||||
// When loading an instance, subclasses can specify default to fetch
|
||||
defaultColumnsToFetch: function defaultColumnsToFetch() {
|
||||
return [];
|
||||
},
|
||||
|
||||
// Bookshelf `initialize` - declare a constructor-like method for model creation
|
||||
initialize: function initialize() {
|
||||
this.initializeEvents();
|
||||
|
|
|
@ -210,6 +210,11 @@ module.exports = function (Bookshelf) {
|
|||
// Fetch the object before destroying it, so that the changed data is available to events
|
||||
const obj = await this.forge(options.destroyBy).fetch(options);
|
||||
return obj.destroy(options);
|
||||
},
|
||||
|
||||
// When loading an instance, subclasses can specify default to fetch
|
||||
defaultColumnsToFetch: function defaultColumnsToFetch() {
|
||||
return [];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue