Typecast issue ids when searched for.
Older Postgres versions don't allow searching over the id field's max size. Contributed by Holger Just git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3806 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
c98f46d691
commit
7376ef2ad7
|
@ -43,7 +43,7 @@ class SearchController < ApplicationController
|
||||||
begin; offset = params[:offset].to_time if params[:offset]; rescue; end
|
begin; offset = params[:offset].to_time if params[:offset]; rescue; end
|
||||||
|
|
||||||
# quick jump to an issue
|
# quick jump to an issue
|
||||||
if @question.match(/^#?(\d+)$/) && Issue.visible.find_by_id($1)
|
if @question.match(/^#?(\d+)$/) && Issue.visible.find_by_id($1.to_i)
|
||||||
redirect_to :controller => "issues", :action => "show", :id => $1
|
redirect_to :controller => "issues", :action => "show", :id => $1
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
@ -134,6 +134,12 @@ class SearchControllerTest < ActionController::TestCase
|
||||||
assert_template 'index'
|
assert_template 'index'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_large_integer
|
||||||
|
get :index, :q => '4615713488'
|
||||||
|
assert_response :success
|
||||||
|
assert_template 'index'
|
||||||
|
end
|
||||||
|
|
||||||
def test_tokens_with_quotes
|
def test_tokens_with_quotes
|
||||||
get :index, :id => 1, :q => '"good bye" hello "bye bye"'
|
get :index, :id => 1, :q => '"good bye" hello "bye bye"'
|
||||||
assert_equal ["good bye", "hello", "bye bye"], assigns(:tokens)
|
assert_equal ["good bye", "hello", "bye bye"], assigns(:tokens)
|
||||||
|
|
Loading…
Reference in New Issue