summaryrefslogtreecommitdiff
path: root/app/models/todo.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-06-13 14:00:19 +0200
committerJames Lopez <james@jameslopez.es>2016-06-13 14:00:19 +0200
commite83fc684a583140ce30644a7062f8470880fdf43 (patch)
tree6c2a2f52da54d58def135757fcb5f14db8dd8a20 /app/models/todo.rb
parentf70c000924c82bc579310fe784a6df159d15618b (diff)
parent6f0c503397e184d2a68eec8d4285288abc29ce9a (diff)
downloadgitlab-ce-e83fc684a583140ce30644a7062f8470880fdf43.tar.gz
Merge branches 'feature/project-export-ui-experimental' and 'feature/project-import' of gitlab.com:gitlab-org/gitlab-ce into feature/project-export-ui-experimental
# Conflicts: # Gemfile.lock # app/helpers/todos_helper.rb # app/models/todo.rb # app/views/projects/edit.html.haml # lib/gitlab/import_export/import_service.rb
Diffstat (limited to 'app/models/todo.rb')
-rw-r--r--app/models/todo.rb28
1 files changed, 7 insertions, 21 deletions
diff --git a/app/models/todo.rb b/app/models/todo.rb
index 3333e56912a..b0401463269 100644
--- a/app/models/todo.rb
+++ b/app/models/todo.rb
@@ -1,25 +1,7 @@
-# == Schema Information
-#
-# Table name: todos
-#
-# id :integer not null, primary key
-# user_id :integer not null
-# project_id :integer not null
-# target_id :integer
-# target_type :string not null
-# author_id :integer
-# action :integer not null
-# state :string not null
-# created_at :datetime
-# updated_at :datetime
-# note_id :integer
-# commit_id :string
-#
-
class Todo < ActiveRecord::Base
- ASSIGNED = 1
- MENTIONED = 2
- IMPORTED = 3
+ ASSIGNED = 1
+ MENTIONED = 2
+ BUILD_FAILED = 3
belongs_to :author, class_name: "User"
belongs_to :note
@@ -47,6 +29,10 @@ class Todo < ActiveRecord::Base
state :done
end
+ def build_failed?
+ action == BUILD_FAILED
+ end
+
def body
if note.present?
note.note