diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-09 12:09:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-09 12:09:27 +0300 |
commit | c3b45354d720654215eb0e7b8e718ba6ea2d7a96 (patch) | |
tree | 359066e91bad08ae8e404bb43316705b7b53993e /app/models/todo.rb | |
parent | 734708924b0f86ad3c23636bd6a8942d679daaf2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/todo.rb')
-rw-r--r-- | app/models/todo.rb | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/app/models/todo.rb b/app/models/todo.rb index 102f36a991e..f973c1ff1d4 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -7,15 +7,16 @@ class Todo < ApplicationRecord # Time to wait for todos being removed when not visible for user anymore. # Prevents TODOs being removed by mistake, for example, removing access from a user # and giving it back again. - WAIT_FOR_DELETE = 1.hour + WAIT_FOR_DELETE = 1.hour - ASSIGNED = 1 - MENTIONED = 2 - BUILD_FAILED = 3 - MARKED = 4 - APPROVAL_REQUIRED = 5 # This is an EE-only feature - UNMERGEABLE = 6 - DIRECTLY_ADDRESSED = 7 + ASSIGNED = 1 + MENTIONED = 2 + BUILD_FAILED = 3 + MARKED = 4 + APPROVAL_REQUIRED = 5 # This is an EE-only feature + UNMERGEABLE = 6 + DIRECTLY_ADDRESSED = 7 + MERGE_TRAIN_REMOVED = 8 # This is an EE-only feature ACTION_NAMES = { ASSIGNED => :assigned, @@ -24,7 +25,8 @@ class Todo < ApplicationRecord MARKED => :marked, APPROVAL_REQUIRED => :approval_required, UNMERGEABLE => :unmergeable, - DIRECTLY_ADDRESSED => :directly_addressed + DIRECTLY_ADDRESSED => :directly_addressed, + MERGE_TRAIN_REMOVED => :merge_train_removed }.freeze belongs_to :author, class_name: "User" @@ -165,6 +167,10 @@ class Todo < ApplicationRecord action == ASSIGNED end + def merge_train_removed? + action == MERGE_TRAIN_REMOVED + end + def done? state == 'done' end |