From 3aae65f744229b2fed173e3d2aceb542d20198e4 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Fri, 22 Feb 2013 14:30:19 +0400 Subject: [PATCH] #757: rename #can_publish_to_repository to #extra_containers_published --- app/models/build_list.rb | 4 ++-- app/views/projects/build_lists/show.html.haml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 860ad8274..4eeea1c9a 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -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 diff --git a/app/views/projects/build_lists/show.html.haml b/app/views/projects/build_lists/show.html.haml index cd62a1849..f15d4745d 100644 --- a/app/views/projects/build_lists/show.html.haml +++ b/app/views/projects/build_lists/show.html.haml @@ -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')