summaryrefslogtreecommitdiff
path: root/app/models/todo.rb
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-06-15 13:20:30 +0200
committerRobert Schilling <rschilling@student.tugraz.at>2016-07-01 10:49:34 +0200
commit631765748ebff2307a078dc6d50ef8367f3c5ff0 (patch)
tree4a6a9cf285de1bbd86b43111addac1d82a1fdc20 /app/models/todo.rb
parent69397d559f837cb55fd50d5d0459523854dcec06 (diff)
downloadgitlab-ce-631765748ebff2307a078dc6d50ef8367f3c5ff0.tar.gz
Expose action_name
Diffstat (limited to 'app/models/todo.rb')
-rw-r--r--app/models/todo.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/todo.rb b/app/models/todo.rb
index 2792fa9b9a8..3ba67078d48 100644
--- a/app/models/todo.rb
+++ b/app/models/todo.rb
@@ -4,6 +4,13 @@ class Todo < ActiveRecord::Base
BUILD_FAILED = 3
MARKED = 4
+ ACTION_NAMES = {
+ ASSIGNED => :assigned,
+ MENTIONED => :mentioned,
+ BUILD_FAILED => :build_failed,
+ MARKED => :marked
+ }
+
belongs_to :author, class_name: "User"
belongs_to :note
belongs_to :project
@@ -34,6 +41,10 @@ class Todo < ActiveRecord::Base
action == BUILD_FAILED
end
+ def action_name
+ ACTION_NAMES[action]
+ end
+
def body
if note.present?
note.note