title: Automatically reload rails module
body: <p>I'm developing a ruby module that I include in my rails app. I want it to be reloaded automatically when it changes. I've done extensive googling, and looked at the various questions here that discuss it, but they all seem out of date or wrong.</p>
  
  <p>How do I get an external module to be reloaded in rails when it changes? I've tried adding its name to <code>ActiveSupport::Dependencies.unloadable_constants</code>, but after I type <code>reload!</code> in the console, I can no longer refer to that symbol without a <code>NameError: uninitialized constant foo</code>, even if I do another <code>require 'foo_module'</code>. Does anyone know how to get this working?</p>
  
  <p>Note: here is <a href="https://stackoverflow.com/questions/1633852/rails-auto-reloading-plug-in-development-mode">one possible dup</a>, but note in the comments to the 'answer' that it never solved the problem for modules. There's also <a href="https://stackoverflow.com/questions/886060/how-do-i-make-the-code-in-lib-automatically-reload-when-the-file-changes">this question</a> which has a dead link in the answer, and finally <a href="https://stackoverflow.com/questions/1114388/rails-reloading-lib-files-without-having-to-restart-server">this one</a>, which also doesn't solve it.</p>