Add validate: false. Add validates uniqueness.
This commit is contained in:
parent
ec34b2d051
commit
d6acd8ec2f
2 changed files with 3 additions and 1 deletions
|
@ -9,7 +9,7 @@ module Ci
|
|||
belongs_to :owner, class_name: 'User'
|
||||
has_one :last_pipeline, -> { order(id: :desc) }, class_name: 'Ci::Pipeline'
|
||||
has_many :pipelines
|
||||
has_many :variables, class_name: 'Ci::PipelineScheduleVariable'
|
||||
has_many :variables, class_name: 'Ci::PipelineScheduleVariable', validate: false
|
||||
|
||||
validates :cron, unless: :importing?, cron: true, presence: { unless: :importing? }
|
||||
validates :cron_timezone, cron_timezone: true, presence: { unless: :importing? }
|
||||
|
|
|
@ -4,5 +4,7 @@ module Ci
|
|||
include HasVariable
|
||||
|
||||
belongs_to :pipeline_schedule
|
||||
|
||||
validates :key, uniqueness: { scope: :pipeline_schedule_id }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue