diff options
author | Robert Speicher <robert@gitlab.com> | 2016-07-12 19:50:33 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-07-12 19:50:33 +0000 |
commit | 33b4fc315ed504511a7f23835939ff8915e0fe01 (patch) | |
tree | 1d2a3abd23857b283df92640ec9aca5e8f0dd5cf /app | |
parent | 7937014e1c4328d979d5d13eeb02a69ae82bf703 (diff) | |
parent | d957d5f1aa45d3a8474678e5439ccdc09a545482 (diff) | |
download | gitlab-ce-33b4fc315ed504511a7f23835939ff8915e0fe01.tar.gz |
Merge branch 'approval-required-todo' into 'master'
Add approval required todos
Ports the 'approval required' todo type from EE - https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/547
See merge request !5217
Diffstat (limited to 'app')
-rw-r--r-- | app/finders/todos_finder.rb | 2 | ||||
-rw-r--r-- | app/helpers/todos_helper.rb | 1 | ||||
-rw-r--r-- | app/models/todo.rb | 12 |
3 files changed, 9 insertions, 6 deletions
diff --git a/app/finders/todos_finder.rb b/app/finders/todos_finder.rb index 1a8f490355b..ff866c2faa5 100644 --- a/app/finders/todos_finder.rb +++ b/app/finders/todos_finder.rb @@ -37,7 +37,7 @@ class TodosFinder private def action_id? - action_id.present? && [Todo::ASSIGNED, Todo::MENTIONED, Todo::BUILD_FAILED, Todo::MARKED].include?(action_id.to_i) + action_id.present? && Todo::ACTION_NAMES.has_key?(action_id.to_i) end def action_id diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 0925760e69c..e3a208f826a 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -13,6 +13,7 @@ module TodosHelper when Todo::MENTIONED then 'mentioned you on' when Todo::BUILD_FAILED then 'The build failed for your' when Todo::MARKED then 'added a todo for' + when Todo::APPROVAL_REQUIRED then 'set you as an approver for' end end diff --git a/app/models/todo.rb b/app/models/todo.rb index ac3fdbc7f3b..8d7a5965aa1 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -1,14 +1,16 @@ class Todo < ActiveRecord::Base - ASSIGNED = 1 - MENTIONED = 2 - BUILD_FAILED = 3 - MARKED = 4 + ASSIGNED = 1 + MENTIONED = 2 + BUILD_FAILED = 3 + MARKED = 4 + APPROVAL_REQUIRED = 5 # This is an EE-only feature ACTION_NAMES = { ASSIGNED => :assigned, MENTIONED => :mentioned, BUILD_FAILED => :build_failed, - MARKED => :marked + MARKED => :marked, + APPROVAL_REQUIRED => :approval_required } belongs_to :author, class_name: "User" |