title: cant load lib directory modules - uninitialized constant - rails 2 to rails 3 upgrade
body: <p>I'm currently migrating an application in rails v2 to v3</p>
  
  <p>In my <code>lib/</code> i've some modules in subdirectories, for example,
  i've the <code>lib/search/host_search.rb</code></p>
  
  <p>with a</p>
  
  <pre><code>  module HostSearch
      def do_search(args)
         #...
      end
    end
  </code></pre>
  
  <p>then I need to use it in a controller named <code>Discovery::HostController &lt; ApplicationController :</code></p>
  
  <pre><code>def search_results
     output = HostSearch.do_search(:search_string =&gt; @search_string, 
       :page =&gt; params[:page],
       :user =&gt; @current_user)
     #...
  end
  </code></pre>
  
  <p>But have I get:</p>
  
  <pre><code>uninitialized constant Discovery::HostController::HostSearch
  </code></pre>
  
  <p>..I tried to put this lines in application.rb but it doesn't work..</p>
  
  <pre><code>config.autoload_paths += %W(#{config.root}/lib)
  config.autoload_paths += Dir["#{config.root}/lib/**/"]
  </code></pre>