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

allow id attribute to be overriden #1034

Merged
merged 1 commit into from
Aug 11, 2015

Conversation

lanej
Copy link
Contributor

@lanej lanej commented Aug 4, 2015

sometimes serialized id and the model id are not the same.

@joaomdmoura
Copy link
Member

Hey @lanej, I'm finally reviewing it 😄
I also see that you did the same to type.
This is something that I was looking forward to have! Would be nice to hear more about what was the scenario that made you do it 😄
Great work, I'm merging this and #1037

joaomdmoura added a commit that referenced this pull request Aug 11, 2015
allow id attribute to be overriden
@joaomdmoura joaomdmoura merged commit f7a1585 into rails-api:master Aug 11, 2015
@lanej
Copy link
Contributor Author

lanej commented Aug 11, 2015

Basic scenario is that I have an old model that has an external id (api presented) and an internal id (database index). I'm currently using an older version of ams to rewrite the "id" portion of the presentation to expose the external id only. Using respond_to? vs method_missing is really the only significant change here.

I have a similar story for #1037

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.

2 participants