From 93a8108425dc323c021ba1d978fc42022f64d150 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Thu, 21 Feb 2013 19:16:16 +0400 Subject: [PATCH] #757: update #prepare_extra_containers, add filtering by arch --- app/models/build_list.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 4180e1d31..c2972dbfe 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -486,8 +486,19 @@ class BuildList < ActiveRecord::Base def prepare_extra_containers bls = BuildList.where(:id => extra_containers).published_container.accessible_by(current_ability, :read) - bls = bls.where(:save_to_platform_id => save_to_platform.id, :arch_id => arch_id) if save_to_platform && save_to_platform.main? - self.extra_containers = bls.pluck(:id) + if save_to_platform && save_to_platform.main? + bls = bls.where(:save_to_platform_id => save_to_platform.id) + if save_to_platform.distrib_type == 'rhel' + bls = bls.where(' + (build_lists.arch_id = ? AND projects.publish_i686_into_x86_64 is not true) OR + (projects.publish_i686_into_x86_64 is true) + ', arch_id).joins(:project) + else + bls = bls.where(:arch_id => arch_id) + end + + end + self.extra_containers = bls.pluck('build_lists.id') end end \ No newline at end of file