diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-05-20 03:46:40 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-05-24 04:38:24 +0300 |
commit | 4345bb8c507a11af694617187dea14284f48fb96 (patch) | |
tree | 20bc96bf6f90f8654492fb4e8b5cb1108e3d131d /lib/constraints/group_url_constrainer.rb | |
parent | 3cfcbcf35badfdb21244f7f16c8640cd83b49205 (diff) |
Fix ambiguous routing issues by teaching router about reserved words
Diffstat (limited to 'lib/constraints/group_url_constrainer.rb')
-rw-r--r-- | lib/constraints/group_url_constrainer.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/constraints/group_url_constrainer.rb b/lib/constraints/group_url_constrainer.rb index 5f379756c11..6fc1d56d7a0 100644 --- a/lib/constraints/group_url_constrainer.rb +++ b/lib/constraints/group_url_constrainer.rb @@ -1,9 +1,9 @@ class GroupUrlConstrainer def matches?(request) - id = request.params[:id] + full_path = request.params[:group_id] || request.params[:id] - return false unless DynamicPathValidator.valid?(id) + return false unless DynamicPathValidator.valid_group_path?(full_path) - Group.find_by_full_path(id, follow_redirects: request.get?).present? + Group.find_by_full_path(full_path, follow_redirects: request.get?).present? end end |