From f90bd06fb3ba8712f91926e1f62283e11847d663 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Mon, 17 Dec 2012 19:14:52 +0400 Subject: [PATCH] #778: separate "binary" and "source" packages --- app/models/project.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/project.rb b/app/models/project.rb index d7152cf27..e904fff44 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -218,8 +218,10 @@ class Project < ActiveRecord::Base packages = packages.for_platform(main_platform.id) if main_platform packages = packages.scoped_to_arch(arch.id). includes(:packages).last(10). - map{ |bl| bl.packages.pluck(:fullname) }.flatten - next if packages.empty? + map{ |bl| bl.packages }.flatten + sources = packages.map{ |p| p.fullname if p.package_type == 'source' }.compact + binaries = packages.map{ |p| p.fullname if p.package_type == 'binary' }.compact + next if sources.empty? && binaries.empty? Resque.push( "publish_build_list_container_#{type}_worker", 'class' => "AbfWorker::PublishBuildListContainer#{type.capitalize}Worker", @@ -227,7 +229,7 @@ class Project < ActiveRecord::Base :id => repository.id, :arch => arch.name, :distrib_type => type, - :packages => packages, + :packages => { :sources => sources, :binaries => binaries }, :platform => { :platform_path => platform_path },