Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/todo.rb')
-rw-r--r--app/models/todo.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/app/models/todo.rb b/app/models/todo.rb
index 32ec4accb4b..7bbdf321269 100644
--- a/app/models/todo.rb
+++ b/app/models/todo.rb
@@ -204,10 +204,18 @@ class Todo < ApplicationRecord
action == MEMBER_ACCESS_REQUESTED
end
- def access_request_url
- return "" unless self.target_type == 'Namespace'
+ def member_access_type
+ target.class.name.downcase
+ end
- Gitlab::Routing.url_helpers.group_group_members_url(self.target, tab: 'access_requests')
+ def access_request_url(only_path: false)
+ if target.instance_of? Group
+ Gitlab::Routing.url_helpers.group_group_members_url(self.target, tab: 'access_requests', only_path: only_path)
+ elsif target.instance_of? Project
+ Gitlab::Routing.url_helpers.project_project_members_url(self.target, tab: 'access_requests', only_path: only_path)
+ else
+ ""
+ end
end
def done?