Skip to content

Commit

Permalink
fix compatibility with ember-data 5
Browse files Browse the repository at this point in the history
  • Loading branch information
AmauryD committed Dec 20, 2023
1 parent 5c7eb86 commit dffddfa
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion addon/models/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions addon/models/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down
2 changes: 1 addition & 1 deletion addon/models/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
9 changes: 9 additions & 0 deletions tests/dummy/config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit dffddfa

Please sign in to comment.