#455: use platform #default_branch for detecting of project version

This commit is contained in:
Vokhmin Alexey V 2015-02-18 01:40:36 +03:00
parent 7efe8894ff
commit 057a2688d4
1 changed files with 4 additions and 4 deletions

View File

@ -210,10 +210,10 @@ class Project < ActiveRecord::Base
end
def project_version_for(save_to_platform, build_for_platform)
if repo.commits("#{save_to_platform.name}").try(:first).try(:id)
save_to_platform.name
elsif repo.commits("#{build_for_platform.name}").try(:first).try(:id)
build_for_platform.name
if repo.commits("#{save_to_platform.default_branch}").try(:first).try(:id)
save_to_platform.default_branch
elsif repo.commits("#{build_for_platform.default_branch}").try(:first).try(:id)
build_for_platform.default_branch
else
default_branch
end