From 45dcfa20329ece74a66635f60f61e633025c700b Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Wed, 22 Mar 2023 10:46:29 +0100 Subject: [PATCH] Allowed `autoRefresh` option to `edit` model method - this allows us to disable auto-refresh in Bookshelf if we don't need an updated model, which saves an extra SQL query --- ghost/core/core/server/models/base/plugins/sanitize.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/core/core/server/models/base/plugins/sanitize.js b/ghost/core/core/server/models/base/plugins/sanitize.js index 2079a27ca0..9344623820 100644 --- a/ghost/core/core/server/models/base/plugins/sanitize.js +++ b/ghost/core/core/server/models/base/plugins/sanitize.js @@ -41,7 +41,7 @@ module.exports = function (Bookshelf) { case 'add': return baseOptions.concat(extraOptions, ['autoRefresh']); case 'edit': - return baseOptions.concat(extraOptions, ['id', 'require']); + return baseOptions.concat(extraOptions, ['id', 'require', 'autoRefresh']); case 'findOne': return baseOptions.concat(extraOptions, ['columns', 'require', 'mongoTransformer']); case 'findAll':