-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
sparse fieldsets #700
sparse fieldsets #700
Conversation
…_associations was getting changed.
…using includes with fields
self.class._attributes.dup | ||
end | ||
|
||
attributes.each_with_object({}) do |name, hash| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this change belongs into the serializer. The serializer should just return all attributes, where jsonapi adapter would then intersect the ones it needs. I think this should go inside JsonApiAdapter
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would agree If it just returned the attribute names but it calls send for each attribute. It would be terribly inefficient to call the method just to filter it out later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kurko any suggestions?
http://jsonapi.org/format/#fetching-sparse-fieldsets