We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c2f83c commit fa9e3a6Copy full SHA for fa9e3a6
lib/grape/dsl/inside_route.rb
@@ -16,8 +16,7 @@ module InsideRoute
16
# options. `:include_parent_namespaces` defaults to true, hence must be set to false if
17
# you want only to return params declared against the current/target endpoint.
18
def declared(params, options = {}, declared_params = nil)
19
- options[:include_missing] = true unless options.key?(:include_missing)
20
- options[:include_parent_namespaces] = true unless options.key?(:include_parent_namespaces)
+ options.reverse_merge!(include_missing: true, include_parent_namespaces: true)
21
22
declared_params ||= (!options[:include_parent_namespaces] ? route_setting(:declared_params) : (route_setting(:saved_declared_params) || [])).flatten(1) || []
23
0 commit comments