From 5172b2a76c92d8ee4b40ee6d47ea3af6bb51a931 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Tue, 10 Jun 2008 03:11:37 +0000 Subject: [PATCH] ActionItem392: making test pass with postgres --- app/controllers/public/search_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/public/search_controller.rb b/app/controllers/public/search_controller.rb index e2e77e9..7a3871e 100644 --- a/app/controllers/public/search_controller.rb +++ b/app/controllers/public/search_controller.rb @@ -101,7 +101,8 @@ class SearchController < ApplicationController LIST_LIMIT = 10 def complete_region - @regions = Region.find(:all, :conditions => [ 'name like ? and lat is not null and lng is not null', '%' + params[:region][:name] + '%' ]) + # FIXME this logic should be in the model + @regions = Region.find(:all, :conditions => [ '(name like ? or name like ?) and lat is not null and lng is not null', '%' + params[:region][:name] + '%', '%' + params[:region][:name].capitalize + '%' ]) render :action => 'complete_region', :layout => false end -- libgit2 0.21.2