Redo build_list publish to check returned status. Refs #77

This commit is contained in:
Pavel Chipiga 2011-12-22 01:31:05 +02:00
parent 71da0a51d8
commit 2ac4391edf
1 changed files with 6 additions and 7 deletions

View File

@ -105,11 +105,10 @@ class BuildList < ActiveRecord::Base
end
def publish
return false unless can_publish?
has_published = BuildServer.publish_container bs_id
update_attribute(:status, BUILD_PUBLISHED) if has_published == 0
BuildServer.publish_container bs_id
self.update_attribute(:status, BUILD_PUBLISHED)
#self.destroy # self.delete
return has_published == 0
end
def can_publish?