mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03: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
@ -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…
Reference in New Issue
Block a user