Commit c3668be95ad890dbf6ee8e5fd730d53d636810bf

Authored by AntonioTerceiro
1 parent 5ad505de

ActionItem237: workaround for ambiguity between liblocale-ruby1.8 and

libgettext-ruby1.8 in Debian.


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1580 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/helpers/search_helper.rb
... ... @@ -12,6 +12,6 @@ module SearchHelper
12 12 end
13 13  
14 14 def remove_stop_words(query)
15   - (query.downcase.scan(/"[^"]*"?|'[^']*'?|[^'"\s]+/) - STOP_WORDS[Locale.current.to_s]).join(' ')
  15 + (query.downcase.scan(/"[^"]*"?|'[^']*'?|[^'"\s]+/) - (STOP_WORDS[locale] || [])).join(' ')
16 16 end
17 17 end
... ...
config/environment.rb
... ... @@ -84,7 +84,7 @@ Noosfero.locales = {
84 84 }
85 85 # if you want to override this, do it in config/local.rb !
86 86 Noosfero.default_locale = 'en'
87   -require 'locale'
  87 +require 'locale.so'
88 88  
89 89 Tag.hierarchical = true
90 90  
... ...
test/functional/search_controller_test.rb
... ... @@ -21,7 +21,7 @@ class SearchControllerTest < Test::Unit::TestCase
21 21 end
22 22  
23 23 should 'filter stop words' do
24   - GetText.locale = 'pt_BR'
  24 + @controller.expects(:locale).returns('pt_BR').at_least_once
25 25 get 'index', :query => 'a carne da vaca'
26 26 assert_response :success
27 27 assert_template 'index'
... ...