Fixes #2347 - Correct full path building for lateral scopes#2469
Merged
dblock merged 3 commits intoruby-grape:masterfrom Jul 7, 2024
Merged
Fixes #2347 - Correct full path building for lateral scopes#2469dblock merged 3 commits intoruby-grape:masterfrom
dblock merged 3 commits intoruby-grape:masterfrom
Conversation
60ec116 to
31ce885
Compare
dblock
requested changes
Jul 5, 2024
Member
dblock
left a comment
There was a problem hiding this comment.
Thanks for fixing this! Forgive me for nitpicking.
CHANGELOG.md
Outdated
|
|
||
| * [#2467](https://github.com/ruby-grape/grape/pull/2467): Fix repo coverage - [@ericproulx](https://github.com/ericproulx). | ||
| * [#2468](https://github.com/ruby-grape/grape/pull/2468): Align `error!` method signatures across different places - [@numbata](https://github.com/numbata). | ||
| * [#2469](https://github.com/ruby-grape/grape/pull/2469): Fixes #2347 - Correct full path building for lateral scopes - [@numbata](https://github.com/numbata). |
Member
There was a problem hiding this comment.
Let’s say “Fix” to match other lines.
| # @return [Array<Symbol>] the nesting/path of the current parameter scope | ||
| def full_path | ||
| nested? ? @parent.full_path + [@element] : [] | ||
| return (@parent.full_path + [@element]) if nested? |
Member
There was a problem hiding this comment.
I dislike the double return, can we do
if
…
elsif
…
else
…
then we can omit the returns altogether
Contributor
Author
There was a problem hiding this comment.
Actually, it was my first implementation (with "if-else"), but then rubocop shamed me for huge amount of lines of class.
Member
There was a problem hiding this comment.
I usually just do rubocop -a ; rubocop --auto-gen-config.
58d54c3 to
cc54313
Compare
dblock
approved these changes
Jul 7, 2024
This was referenced Jul 7, 2024
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.
Should fix the #2347 issue.
This pull request fixes an issue where the full_path method would stop building the full path when encountering lateral scopes like
withorgiven. The updated method now correctly handles these cases, ensuring accurate path constructionThanks @seriousdev-gh for the spec.