From dffddfa311e0f1d53cfa9ace2e97c90d81263cbe Mon Sep 17 00:00:00 2001 From: AmauryD Date: Wed, 20 Dec 2023 21:20:08 +0100 Subject: [PATCH] fix compatibility with ember-data 5 --- .github/workflows/ci-cd.yml | 1 + addon/models/class.js | 2 +- addon/models/module.js | 4 ++-- addon/models/project.js | 2 +- tests/dummy/config/ember-try.js | 9 +++++++++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index a877a2fbf..0cca9b7e2 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -98,6 +98,7 @@ jobs: try-scenario: - 'ember-lts-4.4' - 'ember-lts-4.8' + - 'ember-lts-5.4' - 'ember-release' - 'ember-beta' - 'ember-canary' diff --git a/addon/models/class.js b/addon/models/class.js index f2ce23fce..b7e5ea53b 100644 --- a/addon/models/class.js +++ b/addon/models/class.js @@ -3,7 +3,7 @@ import { filterBy, or, union } from '@ember/object/computed'; import { memberUnion, hasMemberType } from '../utils/computed'; export default class Class extends Model { - @belongsTo('class', { async: false, inverse: null }) + @belongsTo('class', { async: false, inverse: null, polymorphic: false }) parentClass; isClass = true; diff --git a/addon/models/module.js b/addon/models/module.js index 4887ba3bd..eb40ea0b9 100644 --- a/addon/models/module.js +++ b/addon/models/module.js @@ -10,10 +10,10 @@ export default class Module extends Model { @attr functions; - @hasMany('class', { async: false, inverse: null }) + @hasMany('class', { async: false, inverse: null, polymorphic: true }) classes; - @hasMany('class', { async: false, inverse: null }) + @hasMany('class', { async: false, inverse: null, polymorphic: true }) components; /* diff --git a/addon/models/project.js b/addon/models/project.js index a7c67e3e2..4186a39c0 100644 --- a/addon/models/project.js +++ b/addon/models/project.js @@ -13,6 +13,6 @@ export default class Project extends Model { @attr navigationIndex; - @hasMany('module', { async: false, inverse: null }) + @hasMany('module', { async: false, inverse: null, polymorphic: false }) modules; } diff --git a/tests/dummy/config/ember-try.js b/tests/dummy/config/ember-try.js index 646303c14..fcc3c8a3d 100644 --- a/tests/dummy/config/ember-try.js +++ b/tests/dummy/config/ember-try.js @@ -23,6 +23,15 @@ module.exports = async function () { }, }, }, + { + name: 'ember-lts-5.4', + npm: { + devDependencies: { + 'ember-data': '~5.3.0', + 'ember-source': '~5.4.0', + }, + }, + }, { name: 'ember-release', npm: {