#298: updated logic of #can_auto_publish? method

This commit is contained in:
Vokhmin Alexey V 2013-09-09 23:42:13 +04:00
parent 04fe55b202
commit be6e872592
1 changed files with 1 additions and 1 deletions

View File

@ -283,7 +283,7 @@ class BuildList < ActiveRecord::Base
def can_auto_publish? def can_auto_publish?
return false if !(auto_publish? && can_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| source_packages.each do |nsp|
sp = last_bl.source_packages.find{ |sp| nsp.name == sp.name } sp = last_bl.source_packages.find{ |sp| nsp.name == sp.name }
return true unless sp return true unless sp