From 057a2688d414e55236754561144e0715dae73247 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Wed, 18 Feb 2015 01:40:36 +0300 Subject: [PATCH] #455: use platform #default_branch for detecting of project version --- app/models/project.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/project.rb b/app/models/project.rb index 0d33a5720..a2b41ffec 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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