diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-03-10 15:08:21 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-03-10 15:08:21 +0000 |
commit | 38823e3e83aefee02263064a1014285578ac39b3 (patch) | |
tree | ffffd256a30a144b6b064e97f41e1c63a69c0c21 | |
parent | a1f4531069cc6735662166a7a5e4c1641ffb1463 (diff) | |
parent | f2992cf343c28736efa5b49fc6a4c3e40a9f0a8f (diff) | |
download | gitlab-ce-38823e3e83aefee02263064a1014285578ac39b3.tar.gz |
Merge branch 'optimize-project-ci-services' into 'master'
Optimize Project#ci_service(s)
Related issue: gitlab-org/gitlab-ce#14186
See merge request !3158
-rw-r--r-- | app/models/project.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 426464dee81..65829bec77a 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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? |