Skip to content

Commit

Permalink
Fix the full_path for the lateral scope
Browse files Browse the repository at this point in the history
  • Loading branch information
numbata committed Jul 4, 2024
1 parent cc998c3 commit 31ce885
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/grape/validations/params_scope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ def push_declared_params(attrs, **opts)
#
# @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?
return @parent.full_path if lateral?

[]
end

private
Expand Down

0 comments on commit 31ce885

Please sign in to comment.