diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-05-29 23:46:56 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-05-29 23:46:56 +0300 |
commit | 9dfecec53d907a8beb6c2f119d6688aa92c959fd (patch) | |
tree | 0728951313104887c19f17c5664f5ccabb3b6a7f /app/models | |
parent | 1ac12698c613774bdace72475573916c142a07e4 (diff) | |
parent | d94e1aad57d79d93d0add92aa1887c50ee2b27f2 (diff) |
Merge branch '32790-pipeline_schedules-pages-throwing-error-500' into 'master'
Resolve "pipeline_schedules pages throwing error 500"
Closes #32790
See merge request !11706
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/ci/pipeline_schedule.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/app/models/ci/pipeline_schedule.rb b/app/models/ci/pipeline_schedule.rb index cf6e53c4ca4..07213ca608a 100644 --- a/app/models/ci/pipeline_schedule.rb +++ b/app/models/ci/pipeline_schedule.rb @@ -10,9 +10,9 @@ module Ci has_one :last_pipeline, -> { order(id: :desc) }, class_name: 'Ci::Pipeline' has_many :pipelines - validates :cron, unless: :importing_or_inactive?, cron: true, presence: { unless: :importing_or_inactive? } - validates :cron_timezone, cron_timezone: true, presence: { unless: :importing_or_inactive? } - validates :ref, presence: { unless: :importing_or_inactive? } + validates :cron, unless: :importing?, cron: true, presence: { unless: :importing? } + validates :cron_timezone, cron_timezone: true, presence: { unless: :importing? } + validates :ref, presence: { unless: :importing? } validates :description, presence: true before_save :set_next_run_at @@ -32,10 +32,6 @@ module Ci update_attribute(:active, false) end - def importing_or_inactive? - importing? || inactive? - end - def runnable_by_owner? Ability.allowed?(owner, :create_pipeline, project) end |