diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-07-04 15:50:03 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-07-04 15:50:03 +0200 |
commit | 22d8460b5d9926d7608d23aeb58e20d9035efa92 (patch) | |
tree | b0c54448933f7a737765cb1d1d467ba768e043c2 /app/models/ci/stage.rb | |
parent | a17c90b2a7331a7427813684b04095b55c4b3cc1 (diff) | |
download | gitlab-ce-22d8460b5d9926d7608d23aeb58e20d9035efa92.tar.gz |
Add some validations to persisted stage model
Diffstat (limited to 'app/models/ci/stage.rb')
-rw-r--r-- | app/models/ci/stage.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/ci/stage.rb b/app/models/ci/stage.rb index 0c7f8c7f485..da1c3753924 100644 --- a/app/models/ci/stage.rb +++ b/app/models/ci/stage.rb @@ -1,6 +1,7 @@ module Ci class Stage < ActiveRecord::Base extend Ci::Model + include Importable include HasStatus enumerated_status! @@ -10,5 +11,9 @@ module Ci has_many :statuses, class_name: 'CommitStatus', foreign_key: :commit_id has_many :builds, foreign_key: :commit_id + + validates :project, presence: true, unless: :importing? + validates :pipeline, presence: true, unless: :importing? + validates :name, presence: true, unless: :importing? end end |