From 2844e9090238fb24a28a89506aab24d8f381e4f3 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 3 Dec 2012 21:52:32 +0000 Subject: [PATCH] Code cleanup. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10933 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/search_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 7d4ac5599..96366fc02 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -40,8 +40,8 @@ class SearchController < ApplicationController begin; offset = params[:offset].to_time if params[:offset]; rescue; end # quick jump to an issue - if @question.match(/^#?(\d+)$/) && Issue.visible.find_by_id($1.to_i) - redirect_to :controller => "issues", :action => "show", :id => $1 + if (m = @question.match(/^#?(\d+)$/)) && (issue = Issue.visible.find_by_id(m[1].to_i)) + redirect_to issue_path(issue) return end