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

Read default serializer options from the controller #26

Merged
merged 1 commit into from
Nov 20, 2014

Conversation

andrusha
Copy link
Contributor

This allows you to do something like:

helper do
  def default_serializer_options
    {only: params[:only], except: params[:except]}
  end
end

And then on any route you could fetch only fields you actually need. There are many other use-cases of course, but this was my main motivation.

@andrusha
Copy link
Contributor Author

Tests are failing because of #24. @sonxurxo could you take a look?

@jrhe
Copy link
Member

jrhe commented Oct 12, 2014

Can you write some tests for this and also document it in the readme? Ready to merge otherwise.

@siong1987
Copy link
Member

@jrhe i added the required spec on #30 and also updated the README. merge?

@jrhe jrhe merged commit 704838e into ruby-grape:master Nov 20, 2014
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.

3 participants