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:
authorJacopo <beschi.jacopo@gmail.com>2017-04-10 18:51:15 +0300
committerJacopo <beschi.jacopo@gmail.com>2017-04-28 15:24:32 +0300
commit60e9405bb71cef461a4bc2d6a5d706a558a9dc32 (patch)
treeacde27624d0e76f7384010f1d4e9c615db7e2e51 /app/models/todo.rb
parent9a905e1b9f9575bb8d637560cb3c59fd82079d2d (diff)
Improve text on todo list when the todo action comes from yourself
Improved todo message when an issue is assigned to yourself. - The new message when an user assign to himself an issue or a mr is: "You assigned issue xx to yourself" - The new message when an user adds a todo to himself is: "You added a todo for issue xx" - The new message when and user mention himself is: "You mentioned yourself on issue xx" - The new message when an user directly address himself is: "You directly addressed yourself on issue xx" - The new message when an user mark himself as an approver is: "You set yourself as an approver for merge request xx"
Diffstat (limited to 'app/models/todo.rb')
-rw-r--r--app/models/todo.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/todo.rb b/app/models/todo.rb
index da3fa7277c2..b011001b235 100644
--- a/app/models/todo.rb
+++ b/app/models/todo.rb
@@ -84,6 +84,10 @@ class Todo < ActiveRecord::Base
action == BUILD_FAILED
end
+ def assigned?
+ action == ASSIGNED
+ end
+
def action_name
ACTION_NAMES[action]
end
@@ -117,6 +121,14 @@ class Todo < ActiveRecord::Base
end
end
+ def self_added?
+ author == user
+ end
+
+ def self_assigned?
+ assigned? && self_added?
+ end
+
private
def keep_around_commit