From be6e872592cc3568c72816b8693f2994faa98311 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Mon, 9 Sep 2013 23:42:13 +0400 Subject: [PATCH] #298: updated logic of #can_auto_publish? method --- app/models/build_list.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 7abe997e4..aa16cbf3a 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -283,7 +283,7 @@ class BuildList < ActiveRecord::Base def can_auto_publish? return false if !(auto_publish? && can_publish?) - if last_bl = last_published.last + if last_bl = last_published.joins(:source_packages).where(:build_list_packages => {:actual => true}).last source_packages.each do |nsp| sp = last_bl.source_packages.find{ |sp| nsp.name == sp.name } return true unless sp