commit helper refactoring

This commit is contained in:
Valery Sizov 2011-12-28 01:06:55 +02:00
parent 5d6e79f4b9
commit 49b5805709

View file

@ -30,8 +30,7 @@ module CommitsHelper
message.split(/(#[0-9]+)/m).each do |m| message.split(/(#[0-9]+)/m).each do |m|
if m =~ /(#([0-9]+))/m if m =~ /(#([0-9]+))/m
begin begin
issue = Issue.find($2) issue = project.issues.find($2)
raise Exception('Issue not belonging to current project, not creating link !') unless issue.project_id == project.id
out += link_to($1, project_issue_path(project, $2)) out += link_to($1, project_issue_path(project, $2))
rescue rescue
out += $1 out += $1