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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
f6dd8a52
Commit
f6dd8a52
authored
May 07, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move runner validator to separate private method
parent
8ab4a67c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
app/models/ci/runner.rb
app/models/ci/runner.rb
+10
-6
No files found.
app/models/ci/runner.rb
View file @
f6dd8a52
...
...
@@ -26,12 +26,7 @@ module Ci
.
where
(
"ci_runner_projects.gl_project_id = :project_id OR ci_runners.is_shared = true"
,
project_id:
project_id
)
end
validate
do
|
runner
|
unless
runner
.
has_tags?
||
runner
.
run_untagged?
errors
.
add
(
:tags_list
,
'can not be empty when runner is not allowed to pick untagged jobs'
)
end
end
validate
:verify_tags_constraints
acts_as_taggable
...
...
@@ -107,5 +102,14 @@ module Ci
def
has_tags?
tag_list
.
any?
end
private
def
verify_tags_constraints
unless
has_tags?
||
run_untagged?
errors
.
add
(
:tags_list
,
'can not be empty when runner is not allowed to pick untagged jobs'
)
end
end
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