Skip to content

Commit b473fc0

Browse files
committed
Fix route requirements bug
This was a bug introduced by commit 9f4ba67. The commit replaces `options[:route_options].clone.merge(...)` with `options[:route_options].clone.reverse_merge(...)`. That causes disappear of the requirements in namespace.
1 parent f68a385 commit b473fc0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Your contribution here.
1010
* [#1776](https://github.com/ruby-grape/grape/pull/1776): Validate response returned by the exception handler - [@darren987469](https://github.com/darren987469).
1111
* [#1787](https://github.com/ruby-grape/grape/pull/1787): Add documented but not implemented ability to `.insert` a middleware in the stack - [@michaellennox](https://github.com/michaellennox).
12+
* [#1788](https://github.com/ruby-grape/grape/pull/1788): Fix route requirements bug - [@darren987469](https://github.com/darren987469), [@darrellnash](https://github.com/darrellnash).
1213

1314
### 1.1.0 (8/4/2018)
1415

lib/grape/endpoint.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def prepare_version
200200
end
201201

202202
def merge_route_options(**default)
203-
options[:route_options].clone.reverse_merge(**default)
203+
options[:route_options].clone.merge(**default)
204204
end
205205

206206
def map_routes

0 commit comments

Comments
 (0)