Commit 38823e3e authored by Douwe Maan's avatar Douwe Maan

Merge branch 'optimize-project-ci-services' into 'master'

Optimize Project#ci_service(s)

Related issue: gitlab-org/gitlab-ce#14186

See merge request !3158
parents a1f45310 f2992cf3
......@@ -528,11 +528,11 @@ class Project < ActiveRecord::Base
end
def ci_services
services.select { |service| service.category == :ci }
services.where(category: :ci)
end
def ci_service
@ci_service ||= ci_services.find(&:activated?)
@ci_service ||= ci_services.reorder(nil).find_by(active: true)
end
def jira_tracker?
......
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