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:
authorDylan Griffith <dyl.griffith@gmail.com>2019-10-17 08:15:07 +0300
committerDylan Griffith <dyl.griffith@gmail.com>2019-10-23 03:29:14 +0300
commit920c7a4abe28dac1d1b26098ece2d912c01d9584 (patch)
treeb920b2f8a8d074fb9a33264e26910991c9918246 /app/models
parent0df265b6600c12fb6ed3d068e92e8e2b3ddf0dab (diff)
Add #to_ability_name to Project & Milestone
This will be used later for search filtering.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/milestone.rb4
-rw-r--r--app/models/project.rb4
2 files changed, 8 insertions, 0 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb
index 2fa0cfc9b93..a9f4cdec901 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -261,6 +261,10 @@ class Milestone < ApplicationRecord
group || project
end
+ def to_ability_name
+ model_name.singular
+ end
+
def group_milestone?
group_id.present?
end
diff --git a/app/models/project.rb b/app/models/project.rb
index 9c157b344e8..baf69e6bd00 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1264,6 +1264,10 @@ class Project < ApplicationRecord
end
end
+ def to_ability_name
+ model_name.singular
+ end
+
# rubocop: disable CodeReuse/ServiceClass
def execute_hooks(data, hooks_scope = :push_hooks)
run_after_commit_or_now do