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

Add ID Resolver #166

Closed
elado opened this issue Sep 12, 2014 · 2 comments
Closed

Add ID Resolver #166

elado opened this issue Sep 12, 2014 · 2 comments
Assignees
Milestone

Comments

@elado
Copy link

elado commented Sep 12, 2014

Methods like destroy require id, and can't get the actual model as a parameter.

A resolver would get the idAttribute from the model. For example:

Article.destroy(article)

will access article[Article.idAttribute] to find ID in case this is an object.

Thoughts?

@jmdobry
Copy link
Member

jmdobry commented Sep 12, 2014

Yes, there are two methods (at least) that support the id or instance API. I should probably make the API more consistent and use it everywhere or nowhere.

@jmdobry jmdobry added this to the 1.0.0-rc.2 milestone Sep 12, 2014
@jmdobry jmdobry self-assigned this Sep 12, 2014
@elado
Copy link
Author

elado commented Sep 12, 2014

👍 thanks!

@jmdobry jmdobry added done and removed ready labels Sep 15, 2014
jmdobry added a commit to js-data/js-data that referenced this issue Sep 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants