title: rails 4 - require class in initializer or module that uses it - best practice
body: <p>I'm a fairly new RoR dev and ran into a question about best practices for <code>require</code> ing files from <code>lib</code> in Rails 4. </p>
  
  <p><strong>Background:</strong> </p>
  
  <p>As it stands, files in my app's <code>lib</code> don't get autoloaded. I want to require a helper class called <code>rate_limiter</code> that lives in a subdirectory of <code>lib</code>. I've also created a <code>throttle</code> module that handles routes related to rate limiting, and uses this <code>rate_limiter</code> class.</p>
  
  <p>The <code>throttle</code> module is already required at the top of my application controller.</p>
  
  <p><strong>Question</strong>: to make sure <code>rate_limiter</code> gets loaded at start of app, what's better: </p>
  
  <p>1) include an initializer rate_limiter.rb that simply says <code>require rate_limiter</code> to load class. </p>
  
  <p>2) add <code>require rate_limiter</code> to the top of a different module <code>throttle</code>, which uses <code>rate_limiter</code> and which already gets required at the top of application controller.</p>
  
  <p>Wondering about best practices for clarity and maintainability going forward.</p>
  
  <p>Thanks for any suggestions!</p>