-
Notifications
You must be signed in to change notification settings - Fork 151
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
Do not delegate to Kernel methods. #217
Do not delegate to Kernel methods. #217
Conversation
This patch prevents Entity from delegating attributes to Kernel methods. This is accomplished by testing the methods the Entity class responds to for ownership by the Entity class itself. Fixes ruby-grape#215.
The build error seems unrelated ("listen" gem doesn't work with Ruby < 2.2). |
This needs a CHANGELOG entry too, please. Try fixing the build too, please, maybe we just need to lock |
There you go. Removed pry from the test suite, too, as imho it doesn't belong there. When you need it to debug, require it manually. |
@@ -1,7 +1,7 @@ | |||
0.5.2 (Next) | |||
============ | |||
|
|||
* Your contribution here. |
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.
Put this back below your change entry please.
Btw, https://github.com/ruby-grape/grape is failing the same way, if you feel generous today and want to fix :) |
755a089
to
e7312df
Compare
I've put the "Your contrib here" statement back in. Sorry, can't spend any more time on this today for grape, maybe some other time. |
@@ -1,6 +1,7 @@ | |||
0.5.2 (Next) | |||
============ | |||
|
|||
* [#215](https://github.com/ruby-grape/grape-entity/pull/217): `#delegate_attribute` should not delegate to methods included with `Kernel`. |
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.
One last nitpick and then I stop. See the format of these below, your name should be at the end, so - [@...]().
. Thanks.
e7312df
to
bda6d66
Compare
No big deal, keep the code quality up 😄 |
I merged. And still am amending the CHANGELOG a bit since the period is in the wrong place :) |
Thanks for contributing this! It was a major PITA. |
You seem to have a bit too much time :) But thanks for merging! looking forward to getting rid of our monkey-patch. |
This patch prevents Entity from delegating attributes
to Kernel methods. This is accomplished by testing the
methods the Entity class responds to for ownership
by the Entity class itself.
Fixes #215.