diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2016-06-15 13:20:30 +0200 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-07-01 10:49:34 +0200 |
commit | 631765748ebff2307a078dc6d50ef8367f3c5ff0 (patch) | |
tree | 4a6a9cf285de1bbd86b43111addac1d82a1fdc20 /app | |
parent | 69397d559f837cb55fd50d5d0459523854dcec06 (diff) | |
download | gitlab-ce-631765748ebff2307a078dc6d50ef8367f3c5ff0.tar.gz |
Expose action_name
Diffstat (limited to 'app')
-rw-r--r-- | app/models/todo.rb | 11 |
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 |