Commit 8d606e4e authored by lauraMon's avatar lauraMon

Cleans up job finder

parent 6100ba7f
...@@ -49,7 +49,7 @@ module Ci ...@@ -49,7 +49,7 @@ module Ci
end end
def filter_by_scope(builds) def filter_by_scope(builds)
return filter_by_statuses!(params[:scope], builds) if params[:scope].is_a?(Array) return filter_by_statuses!(builds) if params[:scope].is_a?(Array)
case params[:scope] case params[:scope]
when 'pending' when 'pending'
...@@ -63,7 +63,7 @@ module Ci ...@@ -63,7 +63,7 @@ module Ci
end end
end end
def filter_by_statuses!(statuses, builds) def filter_by_statuses!(builds)
unknown_statuses = params[:scope] - ::CommitStatus::AVAILABLE_STATUSES unknown_statuses = params[:scope] - ::CommitStatus::AVAILABLE_STATUSES
raise ArgumentError, 'Scope contains invalid value(s)' unless unknown_statuses.empty? raise ArgumentError, 'Scope contains invalid value(s)' unless unknown_statuses.empty?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment