-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Makes #declared unavailable to before filters #1142
Conversation
In response to issue ruby-grape#1074 This adds a mechanism by which Grape::DSL::InsideRoute methods may be overriden after certain filters are run. The first problem case of a filter being utilized before it should that necessitated this enhancement is the `#declared` method, which was returning un-coerced params in `before` filters. There may be other problem cases, which may be rectified using this same mechanism.
end | ||
end | ||
end | ||
end | ||
|
||
# A filtering method that will return a 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.
It's a little weird to have the docs on the method stub rather than the full version in the PostBeforeFilter
module. Anyone more savvy with YARD know if this is the best way to be doing this?
Please do fix the build, thx. |
Sorry about that. Didn't realize Rubocop was doing its thing. Should be good now. |
This looks good, mind squashing the commits please? |
Needs a CHANGELOG entry and I think something in UPGRADING that says if you used this method before it will now raise ... |
a2acb8e
to
ef2948f
Compare
Squashed, and updated CHANGELOG and UPGRADING docs. |
Makes #declared unavailable to before filters
Merged, thanks. |
Sure thing. Thank you for the thorough review. |
In response to issue #1074
This adds a mechanism by which Grape::DSL::InsideRoute methods may be
overriden after certain filters are run.
The first problem case of a filter being utilized before it should that
necessitated this enhancement is the
#declared
method, which wasreturning un-coerced params in
before
filters.There may be other problem cases, which may be rectified using this same
mechanism.