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

Fix id override #1195

Merged
merged 2 commits into from
Sep 23, 2015
Merged

Fix id override #1195

merged 2 commits into from
Sep 23, 2015

Conversation

beauby
Copy link
Contributor

@beauby beauby commented Sep 23, 2015

Currently, the id attribute is handled in a special way, which leads to the impossibility to override it before the attribute :id call.
I believe this special treatment is just legacy code. @bf4, @joaomdmoura?

@beauby
Copy link
Contributor Author

beauby commented Sep 23, 2015

Ref #1188.

@beauby
Copy link
Contributor Author

beauby commented Sep 23, 2015

Actually, the id check was there because there used to be an id method defined on the Serializer class as follows:

def id
  object.id if object
end

which was there to make sure the JsonApi adapter could get the id. Now the logic has been (rightfully) moved to the JsonApi adapter, so the default id method and the check are not necessary anymore.

@NullVoxPopuli
Copy link
Contributor

👍

NullVoxPopuli added a commit that referenced this pull request Sep 23, 2015
@NullVoxPopuli NullVoxPopuli merged commit f2d0a91 into rails-api:master Sep 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants