diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 5cbc3af5a..c77eba0c5 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -236,13 +236,14 @@ module RepositoriesHelper # 判断项目是否有主版本库 def judge_main_repository(pro) if pro.repositories.blank? - return false + status = false else - pro.repositories.sort.each do |rep| - rep.is_default? - return true + pro.repositories.each do |rep| + status = true and break if rep.is_default? + status = false end end + status end # def cvs_field_tags(form, repository) # content_tag('p', form.text_field(