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

No easy way to serialize ids #3078

Closed
amk221 opened this issue May 18, 2015 · 3 comments
Closed

No easy way to serialize ids #3078

amk221 opened this issue May 18, 2015 · 3 comments

Comments

@amk221
Copy link
Contributor

amk221 commented May 18, 2015

My use case is our API requires the id in a JSON payload to be an integer not a string.

  • Would like to be able to use serializeAttribute, but it doesn't get called with id
  • Could use a combination of serialize, serializeBelongsTo, and serializeHasMany but still requires you to go through all relationships to alter the IDs.
@amk221 amk221 changed the title No easy way to serialize id's as integers No easy way to serialize ids May 18, 2015
@igorT
Copy link
Member

igorT commented May 18, 2015

serializerAttribute isn't the correct place as an id isn't an attribute. Hm, not sure of a nice api that would work with both foreign and primaryKeys. Any ideas?

@amk221
Copy link
Contributor Author

amk221 commented May 18, 2015

Looks like serializeId used to exist:

serializeId: function(id) {

Currently one has to go around the houses (gist)

@wecc
Copy link
Contributor

wecc commented Oct 22, 2016

Closing this as we're tracking the issue in #4477 (should be fixed by #4620)

@wecc wecc closed this as completed Oct 22, 2016
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

No branches or pull requests

4 participants