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

sparse fieldsets #700

Merged
merged 6 commits into from
Jan 6, 2015
Merged

sparse fieldsets #700

merged 6 commits into from
Jan 6, 2015

Conversation

arenoir
Copy link
Contributor

@arenoir arenoir commented Oct 26, 2014

self.class._attributes.dup
end

attributes.each_with_object({}) do |name, hash|
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kurko any suggestions?

@kurko kurko added the V: 0.10.x label Jan 6, 2015
kurko added a commit that referenced this pull request Jan 6, 2015
@kurko kurko merged commit 87f8179 into rails-api:master Jan 6, 2015
@joaomdmoura joaomdmoura mentioned this pull request Oct 6, 2015
11 tasks
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.

2 participants