summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-09-07 00:31:22 +0900
committerShinya Maeda <shinya@gitlab.com>2017-09-07 00:31:22 +0900
commit608cd406076dadc641815dca0fb917317fa80b39 (patch)
tree2fac44e1c774ecf901f4ddf112f969bf377522f0
parentc4c383e6d5e38de260434fe414fbdbe02d0e3763 (diff)
downloadgitlab-ce-fix/sm/33281-activerecord-recordinvalid-when-build-has-nil-protected.tar.gz
-rw-r--r--app/models/ci/build.rb1
-rw-r--r--app/models/ci/pipeline.rb1
2 files changed, 0 insertions, 2 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index ba3156154ac..db4ecb8f8d0 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -27,7 +27,6 @@ module Ci
validates :coverage, numericality: true, allow_blank: true
validates :ref, presence: true
- validates :protected, inclusion: { in: [true, false], unless: :importing? }, on: :create
scope :unstarted, ->() { where(runner_id: nil) }
scope :ignore_failures, ->() { where(allow_failure: false) }
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 35d14b6e297..46e5c344fdc 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -36,7 +36,6 @@ module Ci
validates :sha, presence: { unless: :importing? }
validates :ref, presence: { unless: :importing? }
validates :status, presence: { unless: :importing? }
- validates :protected, inclusion: { in: [true, false], unless: :importing? }, on: :create
validate :valid_commit_sha, unless: :importing?
after_create :keep_around_commits, unless: :importing?