Merge pull request #176 from warpc/169-fix_create_build_list

[refs #169] fix creating build list for empty build version
This commit is contained in:
Vladimir Sharshov 2012-02-08 10:21:40 -08:00
commit e9f3b79bd2
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ class BuildListsController < ApplicationController
Arch.where(:id => params[:arches]).each do |arch|
Platform.main.where(:id => params[:bpls]).each do |bpl|
@build_list = @project.build_lists.build(params[:build_list])
@build_list.commit_hash = @project.git_repository.commits(@build_list.project_version.match(/^latest_(.+)/).to_a.last || @build_list.project_version).first.id
@build_list.commit_hash = @project.git_repository.commits(@build_list.project_version.match(/^latest_(.+)/).to_a.last || @build_list.project_version).first.id if @build_list.project_version
@build_list.bpl = bpl; @build_list.arch = arch; @build_list.user = current_user
flash_options = {:project_version => @build_list.project_version, :arch => arch.name, :bpl => bpl.name, :pl => @build_list.pl}
if @build_list.save