Skip to content

Commit

Permalink
Fix models definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
onechiporenko committed Jul 16, 2023
1 parent db88053 commit ce856da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/dummy/app/models/comment.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Model, { attr, belongsTo } from '@ember-data/model';

export default class UserModel extends Model {
export default class CommentModel extends Model {
@attr('string') date;
@attr('string') text;
@belongsTo('user') author;
@belongsTo('user', { async: true, inverse: 'user' }) author;
}
2 changes: 1 addition & 1 deletion tests/dummy/app/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class UserModel extends Model {
@attr('string') city;
@attr('string') country;

@hasMany('comment') comments;
@hasMany('comment', { async: true, inverse: 'author' }) comments;

get cityWithHtml() {
return `<i>${this.city}</i>`;
Expand Down

0 comments on commit ce856da

Please sign in to comment.