Closed cjbottaro closed 9 years ago
Fixes issue #675 for me.
Haha this is great! I was just warning another developer about doing this kind of thing in a model and then it's pointed out that I've done it myself!!
The require call is only ran once, and so on the second request when it reloads the model it won't run it again. The solution is to do as you've done, or to require them with require_dependency which uses load or require depending on a config setting I forget the name of right now.
Thanks very much for the patch! Travis has run the tests and according to it the tests are fine.
I'll merge now!
This fixes the issue for me. Sorry, couldn't run specs because I don't want to install MySQL, but it seems like a pretty innocuous change.
Pretty sure bug was caused by something related to this: http://guides.rubyonrails.org/autoloading_and_reloading_constants.html#autoloading-and-require
Something about autoloading classes (in
app/
) requiring non-autoloading classes (inlib/
). ¯(ツ)/¯