summaryrefslogtreecommitdiff
path: root/app/models/build.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/build.rb')
-rw-r--r--app/models/build.rb38
1 files changed, 22 insertions, 16 deletions
diff --git a/app/models/build.rb b/app/models/build.rb
index 725da75..7a01ecf 100644
--- a/app/models/build.rb
+++ b/app/models/build.rb
@@ -2,22 +2,23 @@
#
# Table name: builds
#
-# id :integer not null, primary key
-# project_id :integer
-# status :string(255)
-# finished_at :datetime
-# trace :text
-# created_at :datetime
-# updated_at :datetime
-# started_at :datetime
-# runner_id :integer
-# commit_id :integer
-# coverage :float
-# commands :text
-# options :text
-# job_id :integer
-# name :string(255)
-# deploy :boolean default(FALSE)
+# id :integer not null, primary key
+# project_id :integer
+# status :string(255)
+# finished_at :datetime
+# trace :text
+# created_at :datetime
+# updated_at :datetime
+# started_at :datetime
+# runner_id :integer
+# commit_id :integer
+# coverage :float
+# commands :text
+# job_id :integer
+# name :string(255)
+# deploy :boolean default(FALSE)
+# options :text
+# allow_failure :boolean default(FALSE), not null
#
class Build < ActiveRecord::Base
@@ -75,6 +76,7 @@ class Build < ActiveRecord::Base
new_build.commit_id = build.commit_id
new_build.project_id = build.project_id
new_build.name = build.name
+ new_build.allow_failure = build.allow_failure
new_build.save
new_build
end
@@ -153,6 +155,10 @@ class Build < ActiveRecord::Base
canceled? || success? || failed?
end
+ def ignored?
+ failed? && allow_failure?
+ end
+
def timeout
project.timeout
end