-
-
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
delete a reversible stackable values class #1953
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,11 @@ def self.cache_instance(type, method, strict, &_block) | |
end | ||
|
||
def self.cache_key(type, method, strict) | ||
[type, method, strict].compact.map(&:to_s).join('_') | ||
[type, method, strict].each_with_object(+'') do |val, memo| | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess joining '_' is unnecessary since the key is meant for "machines" here. Do you think it is necessary? 🙂 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we 100% sure that type/method/strict don't have the situation like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point! I've changed it. |
||
next if val.nil? | ||
|
||
memo << '_' << val.to_s | ||
end | ||
end | ||
|
||
instance_variable_set(:@__cache, {}) | ||
|
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.
Is there a bug fix 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.
Oh, I forgot to mention this one. Grape::API doesn't make use of
Grape::Util::InheritableSetting
, but Grape::API::Instance does.Thus, there is no reason to expect
Grape::API
.The condition was added when Grape::API worked with
Grape::Util::InheritableSetting
.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.
I understand that part, but without digging into details it's a code change has a side effect. So either we're missing a spec or the entire
if
is unnecessary?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 didn't cause big harm, however, a test for catching the regression makes sense 👍 Please, have a look! 🙂