Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compatibility with ember-data 5 #1517

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 })
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone knowledgeable about this library comes across this, is it normal for 'components' to be a 'class' model rather than a 'component' model ?

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