Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
5d8ee3ed
Commit
5d8ee3ed
authored
May 26, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validate parameters when active is false
parent
602d09ff
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
app/models/ci/pipeline_schedule.rb
app/models/ci/pipeline_schedule.rb
+3
-7
No files found.
app/models/ci/pipeline_schedule.rb
View file @
5d8ee3ed
...
@@ -10,9 +10,9 @@ module Ci
...
@@ -10,9 +10,9 @@ module Ci
has_one
:last_pipeline
,
->
{
order
(
id: :desc
)
},
class_name:
'Ci::Pipeline'
has_one
:last_pipeline
,
->
{
order
(
id: :desc
)
},
class_name:
'Ci::Pipeline'
has_many
:pipelines
has_many
:pipelines
validates
:cron
,
unless: :importing
_or_inactive?
,
cron:
true
,
presence:
{
unless: :importing_or_inactive
?
}
validates
:cron
,
unless: :importing
?
,
cron:
true
,
presence:
{
unless: :importing
?
}
validates
:cron_timezone
,
cron_timezone:
true
,
presence:
{
unless: :importing
_or_inactive
?
}
validates
:cron_timezone
,
cron_timezone:
true
,
presence:
{
unless: :importing?
}
validates
:ref
,
presence:
{
unless: :importing
_or_inactive
?
}
validates
:ref
,
presence:
{
unless: :importing?
}
validates
:description
,
presence:
true
validates
:description
,
presence:
true
before_save
:set_next_run_at
before_save
:set_next_run_at
...
@@ -32,10 +32,6 @@ module Ci
...
@@ -32,10 +32,6 @@ module Ci
update_attribute
(
:active
,
false
)
update_attribute
(
:active
,
false
)
end
end
def
importing_or_inactive?
importing?
||
inactive?
end
def
runnable_by_owner?
def
runnable_by_owner?
Ability
.
allowed?
(
owner
,
:create_pipeline
,
project
)
Ability
.
allowed?
(
owner
,
:create_pipeline
,
project
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment