Commit 5172b2a76c92d8ee4b40ee6d47ea3af6bb51a931

Authored by AntonioTerceiro
1 parent 5468297c

ActionItem392: making test pass with postgres



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1981 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
app/controllers/public/search_controller.rb
... ... @@ -101,7 +101,8 @@ class SearchController < ApplicationController
101 101 LIST_LIMIT = 10
102 102  
103 103 def complete_region
104   - @regions = Region.find(:all, :conditions => [ 'name like ? and lat is not null and lng is not null', '%' + params[:region][:name] + '%' ])
  104 + # FIXME this logic should be in the model
  105 + @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 + '%' ])
105 106 render :action => 'complete_region', :layout => false
106 107 end
107 108  
... ...