#757: rename #can_publish_to_repository to #extra_containers_published

This commit is contained in:
Vokhmin Alexey V 2013-02-22 14:30:19 +04:00
parent 267c3b9b23
commit 3aae65f744
2 changed files with 3 additions and 3 deletions

View File

@ -284,10 +284,10 @@ class BuildList < ActiveRecord::Base
def can_publish?(check_only_status = false)
by_status = [SUCCESS, FAILED_PUBLISH, BUILD_PUBLISHED, TESTS_FAILED].include?(status)
check_only_status ? by_status : (by_status && can_publish_to_repository?)
check_only_status ? by_status : (by_status && extra_containers_published?)
end
def can_publish_to_repository?
def extra_containers_published?
return true unless save_to_platform.main?
BuildList.where(:id => extra_containers).where('status != ?', BUILD_PUBLISHED).count == 0
end

View File

@ -152,7 +152,7 @@
- if @build_list.build_published?
= submit_tag t("layout.publish_again"), :confirm => t("layout.publish_again_warning"), :name => 'publish'
- elsif @build_list.can_publish?(true)
- if !@build_list.can_publish_to_repository?
- if !@build_list.extra_containers_published?
- confirm = t('layout.build_lists.publish_with_extra_fail')
- elsif @build_list.tests_failed?
- confirm = t('layout.build_lists.tests_failed')