title: Adding a directory to the load path in Rails?
body: <p>As of Rails 2.3, what's the right way to add a directory to the load path so that it hooks into Rails' auto-reloading mechanisms?</p>
  
  <p>The specific example I'm thinking of is I have a class that has several sub-classes using STI and I thought it would be a good idea to put them in a sub-directory rather than clutter the top-level.  So I would have something like:</p>
  
  <pre><code>#app/models/widget.rb
  class Widget &lt; ActiveRecord::Base
     add_to_load_path File.join(File.dirname(__FILE__), "widgets")
  end
  
  #app/models/widgets/bar_widget.rb
  class BarWidget &lt; Widget
  end
  
  #app/models/widgets/foo_widget.rb
  class FooWidget &lt; Widget
  end
  </code></pre>
  
  <p>It's the <code>add_to_load_path</code> method that I'm looking for.</p>