Skip to content

Commit

Permalink
corrected class-based definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
runnerboy22 authored and runspired committed Jul 30, 2022
1 parent ffc5c19 commit cdc8a1f
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ module('integration/adapter/store-adapter - DS.Store and DS.Adapter integration
let adapter = store.adapterFor('application');

class Person extends Model {
@hasMany('dog', { async: true }) dogs;
@hasMany({ async: true }) dogs;
}

this.owner.register('model:person', Person);
Expand Down Expand Up @@ -1073,7 +1073,7 @@ module('integration/adapter/store-adapter - DS.Store and DS.Adapter integration
let store = this.owner.lookup('service:store');
let adapter = store.adapterFor('application');
class Person extends Model {
@hasMany('dog', { async: true }) dogs;
@hasMany({ async: true }) dogs;
}

this.owner.register('model:person', Person);
Expand Down Expand Up @@ -1193,7 +1193,7 @@ module('integration/adapter/store-adapter - DS.Store and DS.Adapter integration
let store = this.owner.lookup('service:store');
let adapter = store.adapterFor('application');
class Person extends Model {
@hasMany('dog', { async: true }) dogs;
@hasMany({ async: true }) dogs;
}

this.owner.register('model:person', Person);
Expand Down Expand Up @@ -1237,7 +1237,7 @@ module('integration/adapter/store-adapter - DS.Store and DS.Adapter integration
let store = this.owner.lookup('service:store');
let adapter = store.adapterFor('application');
class Person extends Model {
@hasMany('dog', { async: true }) dogs;
@hasMany({ async: true }) dogs;
}

this.owner.register('model:person', Person);
Expand Down Expand Up @@ -1459,16 +1459,16 @@ module('integration/adapter/store-adapter - DS.Store and DS.Adapter integration
});

test('An async hasMany relationship with links should not trigger shouldBackgroundReloadRecord', async function (assert) {
const Post = Model.extend({
name: attr('string'),
comments: hasMany('comment', { async: true }),
});
class Post extends Model {
@attr('string') name;
@hasMany('comment', { async: true }) comments;
}

const Comment = Model.extend({
name: attr('string'),
});
class Comment extends Model {
@attr('string') name;
}

const ApplicationAdapter = RESTAdapter.extend({
class ApplicationAdapter extends RESTAdapter {
findRecord() {
return {
posts: {
Expand All @@ -1477,7 +1477,7 @@ module('integration/adapter/store-adapter - DS.Store and DS.Adapter integration
links: { comments: '/posts/1/comments' },
},
};
},
}
findHasMany() {
return resolve({
comments: [
Expand All @@ -1486,11 +1486,11 @@ module('integration/adapter/store-adapter - DS.Store and DS.Adapter integration
{ id: '3', name: 'What is omakase?' },
],
});
},
}
shouldBackgroundReloadRecord() {
assert.ok(false, 'shouldBackgroundReloadRecord should not be called');
},
});
}
}

this.owner.register('model:post', Post);
this.owner.register('model:comment', Comment);
Expand Down

0 comments on commit cdc8a1f

Please sign in to comment.