From a9b3d83e00506466c0f5869066d9b16432f2d1b5 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Wed, 14 Oct 2020 11:50:39 +0100 Subject: [PATCH] Loaded Action model after all other models no-issue The Action model loops through all registered models when the file is loaded, by loading the model last, we ensure that it can read all models, rather than an arbitrary selection which come before it. --- core/server/models/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/server/models/index.js b/core/server/models/index.js index 83e1ae4100..69f378cb9b 100644 --- a/core/server/models/index.js +++ b/core/server/models/index.js @@ -28,7 +28,6 @@ const models = [ 'api-key', 'mobiledoc-revision', 'member', - 'action', 'posts-meta', 'member-stripe-customer', 'stripe-customer-subscription', @@ -36,7 +35,10 @@ const models = [ 'email-batch', 'email-recipient', 'label', - 'single-use-token' + 'single-use-token', + // Action model MUST be loaded last as it loops through all of the registered models + // Please do not append items to this array. + 'action' ]; function init() {