Fix project search during auto_build action. Refs #2162

This commit is contained in:
Pavel Chipiga 2011-11-02 22:27:47 +02:00
parent ae6919a240
commit 96e223d0eb
1 changed files with 3 additions and 2 deletions

View File

@ -55,8 +55,9 @@ class ProjectsController < ApplicationController
end end
def auto_build def auto_build
unixname = params[:git_repo].split('/').last uname, unixname = params[:git_repo].split('/')
project = Project.find_by_unixname(unixname) owner = User.find_by_uname(uname) || Group.find_by_uname(uname)
project = Project.where(:owner_id => owner.id, :owner_type => owner.class).find_by_unixname!(unixname)
auto_build_list = AutoBuildList.find_by_project_id(project.id) auto_build_list = AutoBuildList.find_by_project_id(project.id)
# p = params.delete_if{|k,v| k == 'controller' or k == 'action'} # p = params.delete_if{|k,v| k == 'controller' or k == 'action'}