From df8c68301155939ef6eecb2c35f4a1ffbe788f7f Mon Sep 17 00:00:00 2001 From: Wedge Date: Tue, 1 Mar 2016 16:59:56 +0300 Subject: [PATCH] Fixed shifting bug --- app/controllers/api/v1/jobs_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/v1/jobs_controller.rb b/app/controllers/api/v1/jobs_controller.rb index f02bdc1f3..d7200662e 100644 --- a/app/controllers/api/v1/jobs_controller.rb +++ b/app/controllers/api/v1/jobs_controller.rb @@ -13,8 +13,9 @@ class Api::V1::JobsController < Api::V1::BaseController for_platform(platform_ids).pluck('DISTINCT user_id').sample if uid - build_lists = BuildList.for_status([BuildList::BUILD_PENDING, BuildList::RERUN_TESTS]). - where(user_id: uid).oldest.order(:created_at) + build_lists = BuildList.scoped_to_arch(arch_ids). + for_status([BuildList::BUILD_PENDING, BuildList::RERUN_TESTS]). + for_platform(platform_ids).where(user_id: uid).oldest.order(:created_at) ActiveRecord::Base.transaction do if current_user.system?