#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 end
def project_version_for(save_to_platform, build_for_platform) def project_version_for(save_to_platform, build_for_platform)
if repo.commits("#{save_to_platform.name}").try(:first).try(:id) if repo.commits("#{save_to_platform.default_branch}").try(:first).try(:id)
save_to_platform.name save_to_platform.default_branch
elsif repo.commits("#{build_for_platform.name}").try(:first).try(:id) elsif repo.commits("#{build_for_platform.default_branch}").try(:first).try(:id)
build_for_platform.name build_for_platform.default_branch
else else
default_branch default_branch
end end