This commit is contained in:
Shinya Maeda 2017-09-01 01:51:55 +09:00
parent ce7c0ac3db
commit 5547baa3eb
3 changed files with 6 additions and 4 deletions

View File

@ -26,7 +26,7 @@ module Ci
validates :coverage, numericality: true, allow_blank: true
validates :ref, presence: true
validates :protected, inclusion: { in: [ true, false ] }, on: :create
validates :protected, inclusion: { in: [true, false] }, on: :create
scope :unstarted, ->() { where(runner_id: nil) }
scope :ignore_failures, ->() { where(allow_failure: false) }

View File

@ -36,7 +36,7 @@ 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
validates :protected, inclusion: { in: [true, false], unless: :importing? }, on: :create
validate :valid_commit_sha, unless: :importing?
after_create :keep_around_commits, unless: :importing?

View File

@ -80,7 +80,8 @@ module CycleAnalyticsHelpers
sha: project.repository.commit('master').sha,
ref: 'master',
source: :push,
project: project)
project: project,
protected: true)
end
def new_dummy_job(environment)
@ -93,7 +94,8 @@ module CycleAnalyticsHelpers
ref: 'master',
tag: false,
name: 'dummy',
pipeline: dummy_pipeline)
pipeline: dummy_pipeline,
protected: true)
end
end