title: How are require, require_dependency and constants reloading related in Rails?
body: <p><strong>How are <code>require</code> and <code>require_dependency</code> different?</strong><br>
  How can <code>require_dependency</code> automatically reload classes in development but <code>require</code> can't ?</p>
  
  <p>I digged into Rails' <code>ActiveSupport::Dependencies</code> and dispatcher.rb code. What I saw in <code>require_dependency</code>'s code is it basically adds the constants to an <code>autoloaded_constants</code> array. But it gets cleared in <code>clear_application</code> inside dispatcher after each request.</p>
  
  <p>Can someone give a clear explanation or point me to some resources which will help?</p>