diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-04-07 17:06:41 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-04-07 18:34:03 +0200 |
commit | 16a2eba52b8286533d881ec1a0454ca734d41c3f (patch) | |
tree | de79410c3b3bd9eebcd09f6f193ebc77f1a2593d /app | |
parent | 37e7fe2cc90de24c563fe70e4eff6f5d954bb630 (diff) | |
download | gitlab-ce-16a2eba52b8286533d881ec1a0454ca734d41c3f.tar.gz |
Count number of queries
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/builds_controller.rb | 5 | ||||
-rw-r--r-- | app/models/concerns/has_status.rb | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/projects/builds_controller.rb b/app/controllers/projects/builds_controller.rb index add66ce9f84..04e8cdf6256 100644 --- a/app/controllers/projects/builds_controller.rb +++ b/app/controllers/projects/builds_controller.rb @@ -19,6 +19,11 @@ class Projects::BuildsController < Projects::ApplicationController else @builds end + @builds = @builds.includes([ + { pipeline: :project }, + :project, + :tags + ]) @builds = @builds.page(params[:page]).per(30) end diff --git a/app/models/concerns/has_status.rb b/app/models/concerns/has_status.rb index 2f61709110c..dff7b6e3523 100644 --- a/app/models/concerns/has_status.rb +++ b/app/models/concerns/has_status.rb @@ -68,7 +68,7 @@ module HasStatus end scope :created, -> { where(status: 'created') } - scope :relevant, -> { where.not(status: 'created') } + scope :relevant, -> { where(status: AVAILABLE_STATUSES - ['created']) } scope :running, -> { where(status: 'running') } scope :pending, -> { where(status: 'pending') } scope :success, -> { where(status: 'success') } |