From 40805d341a1b759873aa10fca4e3b0f5a58b7364 Mon Sep 17 00:00:00 2001 From: Nicolas Martinos Date: Thu, 14 Sep 2023 18:41:08 +0300 Subject: [PATCH] fix(computed): on Ember 4.12 / embroider v3 --- addon/-private/options.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addon/-private/options.js b/addon/-private/options.js index dfa9a77c..7c4d1a8b 100644 --- a/addon/-private/options.js +++ b/addon/-private/options.js @@ -17,9 +17,12 @@ export default class Options { constructor({ model, attribute, options = {} }) { const optionKeys = keys(options); const createParams = { [OPTION_KEYS]: optionKeys, model, attribute }; - + const someOptionsAreCPs = optionKeys.some((key) => { + return isDescriptor(options[key]) || options[key]?.constructor?.name === 'AliasDecoratorImpl' + }); + // If any of the options is a CP, we need to create a custom class for it - if (optionKeys.some((key) => isDescriptor(options[key]))) { + if (someOptionsAreCPs) { return OptionsObject.extend(options).create(createParams); }