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

Rename adapter and serializer methods to match the new store methods #3306

Merged
merged 1 commit into from
Jun 15, 2015

Conversation

bmac
Copy link
Member

@bmac bmac commented Jun 11, 2015

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

@bmac
Copy link
Member Author

bmac commented Jun 11, 2015

Ping @amk221. I told you I didn't think this change was happening, I was wrong.

@amk221
Copy link
Contributor

amk221 commented Jun 11, 2015

:) thanks for the heads up. I predicted the future

@bmac bmac force-pushed the rename-adapter-serializer branch 2 times, most recently from 333da7d to 3e8c9ab Compare June 11, 2015 15:37
@bmac bmac mentioned this pull request Jun 13, 2015
13 tasks
@bmac bmac force-pushed the rename-adapter-serializer branch from 3e8c9ab to 77cef5c Compare June 13, 2015 16:18
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);
Copy link
Member Author

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');

@bmac bmac force-pushed the rename-adapter-serializer branch from 77cef5c to 3306ed5 Compare June 13, 2015 21:58
case 'find':
return this.urlForFind(id, modelName, snapshot);
case 'findRecord':
return this.urlForFindRecord(id, modelName, snapshot);
case 'findAll':
return this.urlForFindAll(modelName);
Copy link
Member

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?

Copy link
Member Author

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

@igorT
Copy link
Member

igorT commented Jun 14, 2015

I couldn't find any new tests for the deprecated behavior, are they there or do we still need to add them?

@igorT
Copy link
Member

igorT commented Jun 14, 2015

This fails on travis when optional features are turned on

@bmac bmac force-pushed the rename-adapter-serializer branch 6 times, most recently from e7cbfc7 to 4a63fbd Compare June 15, 2015 20:21
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
@bmac bmac force-pushed the rename-adapter-serializer branch from 4a63fbd to fd3d5dd Compare June 15, 2015 21:04
bmac added a commit that referenced this pull request Jun 15, 2015
Rename adapter and serializer methods to match the new store methods
@bmac bmac merged commit adb38e3 into emberjs:master Jun 15, 2015
@bmac bmac deleted the rename-adapter-serializer branch June 15, 2015 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants