summaryrefslogtreecommitdiff
path: root/app/controllers/projects/runners_controller.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-10-23 18:15:13 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2015-10-26 11:23:11 +0100
commit6db014987d3c9cd4595adad70bb8a11ccacf9545 (patch)
tree581e3a1d9b93e0c5f9b9f442aaea3dc0fbeb72e0 /app/controllers/projects/runners_controller.rb
parentf66ec1bc8157e5481ba23660b226267293c85129 (diff)
downloadgitlab-ce-6db014987d3c9cd4595adad70bb8a11ccacf9545.tar.gz
Fix specific runner visibility
Diffstat (limited to 'app/controllers/projects/runners_controller.rb')
-rw-r--r--app/controllers/projects/runners_controller.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/controllers/projects/runners_controller.rb b/app/controllers/projects/runners_controller.rb
index deb07a21416..bfbcf2567f3 100644
--- a/app/controllers/projects/runners_controller.rb
+++ b/app/controllers/projects/runners_controller.rb
@@ -6,11 +6,10 @@ class Projects::RunnersController < Projects::ApplicationController
layout 'project_settings'
def index
- @runners = @ci_project.runners.order('id DESC')
- @specific_runners =
- Ci::Runner.specific.includes(:runner_projects).
- where(Ci::RunnerProject.table_name => { project_id: current_user.authorized_projects } ).
- where.not(id: @runners).order("#{Ci::Runner.table_name}.id DESC").page(params[:page]).per(20)
+ @runners = @ci_project.runners.ordered
+ @specific_runners = current_user.ci_authorized_runners.
+ where.not(id: @ci_project.runners).
+ ordered.page(params[:page]).per(20)
@shared_runners = Ci::Runner.shared.active
@shared_runners_count = @shared_runners.count(:all)
end