File tree Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 20
20
* [ #2593 ] ( https://github.com/ruby-grape/grape/pull/2593 ) : Fix warning message when overriding global registry key - [ @ericproulx ] ( https://github.com/ericproulx ) .
21
21
* [ #2594 ] ( https://github.com/ruby-grape/grape/pull/2594 ) : Fix routes memoization - [ @ericproulx ] ( https://github.com/ericproulx ) .
22
22
* [ #2595 ] ( https://github.com/ruby-grape/grape/pull/2595 ) : Keep ` within_namespace ` as part of our internal api - [ @ericproulx ] ( https://github.com/ericproulx ) .
23
+ * [ #2596 ] ( https://github.com/ruby-grape/grape/pull/2596 ) : Remove ` namespace_reverse_stackable_with_hash ` from public scope - [ @ericproulx ] ( https://github.com/ericproulx ) .
23
24
* Your contribution here.
24
25
25
26
### 2.4.0 (2025-06-18)
Original file line number Diff line number Diff line change @@ -89,15 +89,6 @@ def namespace_stackable_with_hash(key)
89
89
settings . each_with_object ( { } ) { |value , result | result . deep_merge! ( value ) }
90
90
end
91
91
92
- def namespace_reverse_stackable_with_hash ( key )
93
- settings = get_or_set :namespace_reverse_stackable , key , nil
94
- return if settings . blank?
95
-
96
- settings . each_with_object ( { } ) do |setting , result |
97
- result . merge! ( setting ) { |_k , s1 , _s2 | s1 }
98
- end
99
- end
100
-
101
92
private
102
93
103
94
# Execute the block within a context where our inheritable settings are forked
Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ def build_stack
333
333
default_error_formatter : namespace_inheritable ( :default_error_formatter ) ,
334
334
error_formatters : namespace_stackable_with_hash ( :error_formatters ) ,
335
335
rescue_options : namespace_stackable_with_hash ( :rescue_options ) ,
336
- rescue_handlers : namespace_reverse_stackable_with_hash ( : rescue_handlers) ,
336
+ rescue_handlers : rescue_handlers ,
337
337
base_only_rescue_handlers : namespace_stackable_with_hash ( :base_only_rescue_handlers ) ,
338
338
all_rescue_handler : namespace_inheritable ( :all_rescue_handler ) ,
339
339
grape_exceptions_rescue_handler : namespace_inheritable ( :grape_exceptions_rescue_handler )
@@ -377,5 +377,14 @@ def build_response_cookies
377
377
def lint?
378
378
namespace_inheritable ( :lint ) || Grape . config . lint
379
379
end
380
+
381
+ def rescue_handlers
382
+ rescue_handlers = inheritable_setting . namespace_reverse_stackable [ :rescue_handlers ]
383
+ return if rescue_handlers . blank?
384
+
385
+ rescue_handlers . each_with_object ( { } ) do |rescue_handler , result |
386
+ result . merge! ( rescue_handler ) { |_k , s1 , _s2 | s1 }
387
+ end
388
+ end
380
389
end
381
390
end
You can’t perform that action at this time.
0 commit comments