diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-04-16 14:14:57 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-04-21 19:28:17 +0300 |
commit | 6f78038a119af4d63ddf4a7b9df6de229ac6a9dc (patch) | |
tree | cdd6c4aedc5c110690e6c94e1a7fc6b48fbaaab8 | |
parent | b3c2b5f0f7ea5b0279000bd555d7344d786488fb (diff) | |
download | gitlab-ci-6f78038a119af4d63ddf4a7b9df6de229ac6a9dc.tar.gz |
runner page: remove duplication
-rw-r--r-- | app/controllers/runners_controller.rb | 2 | ||||
-rw-r--r-- | app/models/user.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/runners_controller.rb b/app/controllers/runners_controller.rb index 76bdae1..12578b3 100644 --- a/app/controllers/runners_controller.rb +++ b/app/controllers/runners_controller.rb @@ -10,7 +10,7 @@ class RunnersController < ApplicationController def index @runners = @project.runners.order('id DESC') @specific_runners = current_user.authorized_runners. - where.not(id: @runners).order('id DESC').page(params[:page]).per(20) + where.not(id: @runners).order('runners.id DESC').page(params[:page]).per(20) @shared_runners = Runner.shared.active @shared_runners_count = @shared_runners.count(:all) end diff --git a/app/models/user.rb b/app/models/user.rb index 3f2e046..93fe17c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -66,7 +66,7 @@ class User end def authorized_runners - Runner.specific.joins(:runner_projects). + Runner.specific.includes(:runner_projects). where(runner_projects: { project_id: authorized_projects } ) end |