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
path: root/app
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 05:46:52 +0300
commitc2c498087410aacde7f4fdda980d7e31520a287f (patch)
tree7c08417c744faa046df092d45ba5c837f0d0b75e /app
parent3a4876ff713c08e38e37e9aba2e6efaaa3f4bba4 (diff)
Add #to_ability_name to Project & Milestone
This will be used later for search filtering.
Diffstat (limited to 'app')
-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 2ad2838111e..012e72ece5a 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -254,6 +254,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 a1bd5edaba9..02ccd4542f7 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1223,6 +1223,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