Don't cache Class.instance_methods#2328
Merged
dblock merged 1 commit intoruby-grape:masterfrom May 19, 2023
Merged
Conversation
743eec6 to
2f4a462
Compare
Member
|
Care to add a test for this? Could be an integration test that adds a method to |
2f4a462 to
eb57e56
Compare
Author
|
Done. |
Member
|
Test looks good. CHANGELOG needed, danger is about to complain. |
b5c6f79 to
432d36c
Compare
Author
|
Done. |
432d36c to
4c30e8d
Compare
Author
|
Done. |
4c30e8d to
fa06395
Compare
dblock
reviewed
May 19, 2023
CHANGELOG.md
Outdated
|
|
||
| #### Fixes | ||
|
|
||
| * [#2328](https://github.com/ruby-grape/grape/pull/2328): Don't cache Class.instance_methods - [@byroot](https://github.com/byroot). |
Member
There was a problem hiding this comment.
🤦 there's an extra space in front of *
SORRY, we'll get there
Author
There was a problem hiding this comment.
No worries, that's on me for doing these silly mistakes.
Fix: ruby-grape#2258 Some gems or app code may define methods on `Class` after `grape` is loaaded but before `override_all_methods!` is called. As such it's better to check `Class.method_defined?` when doing the override.
fa06395 to
4f27305
Compare
Author
|
Done. |
dblock
approved these changes
May 19, 2023
Member
|
Merged, thanks for hanging in here with me! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: #2258
Some gems or app code may define methods on
Classaftergrapeis loaaded but beforeoverride_all_methods!is called.As such it's better to check
Class.method_defined?when doing the override.