-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Bring back relationship parameter for adapter findHasMany #2252
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,7 +99,7 @@ test("A serializer can materialize a hasMany as an opaque token that can be lazi | |
throw new Error("Adapter's findMany should not be called"); | ||
}; | ||
|
||
env.adapter.findHasMany = function(store, record, link) { | ||
env.adapter.findHasMany = function(store, record, link, relationship) { | ||
equal(link, "/posts/1/comments", "findHasMany link was /posts/1/comments"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wanna assert that the relationship is passed in here correctly? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @igorT looks better now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @igorT should I squash the two commits? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Squashing would be nice 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @igorT I'm going to open a new PR with the squashed commits, will post here the new PR |
||
|
||
return Ember.RSVP.resolve([ | ||
|
@@ -123,7 +123,7 @@ test("An updated `links` value should invalidate a relationship cache", function | |
comments: DS.hasMany('comment', { async: true }) | ||
}); | ||
|
||
env.adapter.findHasMany = function(store, record, link) { | ||
env.adapter.findHasMany = function(store, record, link, relationship) { | ||
if (link === '/first') { | ||
return Ember.RSVP.resolve([ | ||
{ id: 1, body: "First" }, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you changed the type into a relationship in the HasMany, but not in the belongsTo? Also test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@igorT I didn't need to change it because the relationship parameter is already passed in: https://github.com/emberjs/data/blob/master/packages/ember-data/lib/system/store.js#L1788, and the tests already check for it: https://github.com/emberjs/data/blob/master/packages/ember-data/tests/integration/relationships/belongs_to_test.js#L178 or am I missing something here?