-
-
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
Clone non-frozen default params with each use (#1438) #1439
Conversation
d72edad
to
706713c
Compare
Rebased. All tests now passing, so this is ready for review. @dblock |
@@ -12,6 +12,7 @@ | |||
|
|||
#### Fixes | |||
|
|||
* [#1438](/~https://github.com/ruby-grape/grape/pull/1439): Fix for default param modification bug - [@jlfaber](/~https://github.com/jlfaber). |
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.
Lets write something more useful, maybe "Default values in params
are now cloned on assignment"?
@dblock, I've updated the PR:
This should be ready to go if you concur with the changes. |
@@ -6,8 +6,30 @@ def initialize(attrs, options, required, scope) | |||
super | |||
end | |||
|
|||
# return true if we know we cannot dup this object | |||
private def cannot_dup(obj) |
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.
Should be ....?
, but I would write this as the other way around, so maybe duplicatable?
, which is how ActiveRecord calls these things I believe.
This is good. I have nitpicks on naming, otherwise it's ready to go. |
Renamed and reformatted as requested by @dblock . |
No description provided.