Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* [#2918](https://github.com/ruby-grape/grape/pull/2918): Skip the dry-types round trip when a value already is the declared type - [@ericproulx](https://github.com/ericproulx).
* [#2917](https://github.com/ruby-grape/grape/pull/2917): Read path captures out of the router's union match instead of re-running the route's pattern - [@ericproulx](https://github.com/ericproulx).
* [#2921](https://github.com/ruby-grape/grape/pull/2921): Pin the router's request-time isolation regressions through requests instead of its instance variables - [@ericproulx](https://github.com/ericproulx).
* [#2925](https://github.com/ruby-grape/grape/pull/2925): Skip the qualifying-params lookup for params scopes other than `given` - [@ericproulx](https://github.com/ericproulx).
* Your contribution here.

### 4.0.0 (2026-09-07)
Expand Down
7 changes: 7 additions & 0 deletions lib/grape/validations/params_scope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ module Validations
class ParamsScope
attr_reader :parent, :type, :nearest_array_ancestor, :array_depth, :full_path

# The elements a +given+ scope narrowed its Array params down to during
# this request (see #meets_dependency?). Only a scope with a dependency
# ever stores any, so every other scope answers without the fiber-storage
# and tracker lookups -- which #params pays on each nested resolution,
# twice per validator, on every request.
def qualifying_params
return unless @dependent_on

ParamScopeTracker.current&.qualifying_params(self)
end

Expand Down
Loading