#757: rename #can_publish_to_repository to #extra_containers_published
This commit is contained in:
parent
267c3b9b23
commit
3aae65f744
|
@ -284,10 +284,10 @@ class BuildList < ActiveRecord::Base
|
||||||
|
|
||||||
def can_publish?(check_only_status = false)
|
def can_publish?(check_only_status = false)
|
||||||
by_status = [SUCCESS, FAILED_PUBLISH, BUILD_PUBLISHED, TESTS_FAILED].include?(status)
|
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
|
end
|
||||||
|
|
||||||
def can_publish_to_repository?
|
def extra_containers_published?
|
||||||
return true unless save_to_platform.main?
|
return true unless save_to_platform.main?
|
||||||
BuildList.where(:id => extra_containers).where('status != ?', BUILD_PUBLISHED).count == 0
|
BuildList.where(:id => extra_containers).where('status != ?', BUILD_PUBLISHED).count == 0
|
||||||
end
|
end
|
||||||
|
|
|
@ -152,7 +152,7 @@
|
||||||
- if @build_list.build_published?
|
- if @build_list.build_published?
|
||||||
= submit_tag t("layout.publish_again"), :confirm => t("layout.publish_again_warning"), :name => 'publish'
|
= submit_tag t("layout.publish_again"), :confirm => t("layout.publish_again_warning"), :name => 'publish'
|
||||||
- elsif @build_list.can_publish?(true)
|
- 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')
|
- confirm = t('layout.build_lists.publish_with_extra_fail')
|
||||||
- elsif @build_list.tests_failed?
|
- elsif @build_list.tests_failed?
|
||||||
- confirm = t('layout.build_lists.tests_failed')
|
- confirm = t('layout.build_lists.tests_failed')
|
||||||
|
|
Loading…
Reference in New Issue