-
-
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
Rename adapter and serializer methods to match the new store methods #3306
Conversation
Ping @amk221. I told you I didn't think this change was happening, I was wrong. |
:) thanks for the heads up. I predicted the future |
333da7d
to
3e8c9ab
Compare
3e8c9ab
to
77cef5c
Compare
var jsonExtractFindQuery = JSONSerializer.prototype.extractFindQuery; | ||
if (jsonExtractFindQuery !== this.extractFindQuery) { | ||
Ember.deprecate('Serializer#extractFindQuery has been deprecated and renamed to `extractQuery`.'); | ||
return this.extractFindQuery(store, typeClass, payload, id, requestType); |
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.
return this.extractFindQuery(store, typeClass, payload, id, 'findQuery');
77cef5c
to
3306ed5
Compare
case 'find': | ||
return this.urlForFind(id, modelName, snapshot); | ||
case 'findRecord': | ||
return this.urlForFindRecord(id, modelName, snapshot); | ||
case 'findAll': | ||
return this.urlForFindAll(modelName); |
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.
This breaks backwards compatibility as well right? We should keep the old hooks in for 1.13 no?
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.
urlForFindRecord
calls urlForFind
if it looks like it has been overwritten https://github.com/emberjs/data/pull/3306/files#diff-fffd24b16fb23892703ed3ab601e6c80R123
I couldn't find any new tests for the deprecated behavior, are they there or do we still need to add them? |
This fails on travis when optional features are turned on |
e7cbfc7
to
4a63fbd
Compare
Adapter#find -> Adapter#findRecord and Adapter#findQuery -> Adapter#query BuildURLMixin#urlForFind -> BuildURLMixin#urlForFindRecord and BuildURLMixin#urlForFindQuery -> BuildURLMixin#urlForQuery Serializer#extractFind -> Serializer#extractFindRecord and Serializer#findQuery -> Serializer#extractQuery
4a63fbd
to
fd3d5dd
Compare
Rename adapter and serializer methods to match the new store methods
Adapter#find
->Adapter#findRecord
andAdapter#findQuery
->Adapter#query
BuildURLMixin#urlForFind
->BuildURLMixin#urlForFindRecord
andBuildURLMixin#urlForFindQuery
->BuildURLMixin#urlForQuery
Serializer#extractFind
->Serializer#extractFindRecord
andSerializer#findQuery
->Serializer#extractQuery