diff options
author | Dylan Griffith <dyl.griffith@gmail.com> | 2019-10-17 16:15:07 +1100 |
---|---|---|
committer | Dylan Griffith <dyl.griffith@gmail.com> | 2019-10-23 13:48:00 +1100 |
commit | f8a130b16a59f5ba2b4513faa896fbace7a2ae45 (patch) | |
tree | eee6069ce7da356f30d92ddfa96448ca0c9a9d2a /app | |
parent | ba8b47a7c0c19b404a89f7098ea648ff26d3d658 (diff) | |
download | gitlab-ce-f8a130b16a59f5ba2b4513faa896fbace7a2ae45.tar.gz |
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.rb | 4 | ||||
-rw-r--r-- | app/models/project.rb | 4 |
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 3525f37f8d5..4d9234e482f 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1260,6 +1260,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 |