diff options
Diffstat (limited to 'app/controllers/groups')
-rw-r--r-- | app/controllers/groups/application_controller.rb | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/app/controllers/groups/application_controller.rb b/app/controllers/groups/application_controller.rb index 209d8b1a08a..2157a56dea2 100644 --- a/app/controllers/groups/application_controller.rb +++ b/app/controllers/groups/application_controller.rb @@ -9,20 +9,11 @@ class Groups::ApplicationController < ApplicationController private def group - unless @group - given_path = params[:group_id] || params[:id] - @group = Group.find_by_full_path(given_path, follow_redirects: request.get?) - - if @group && can?(current_user, :read_group, @group) - ensure_canonical_path(@group, given_path) - else - @group = nil - - route_not_found - end - end + @group ||= find_routable!(Group, requested_full_path) + end - @group + def requested_full_path + params[:group_id] || params[:id] end def group_projects |