views:

45

answers:

1

I've got a few classes in lib/ which are not reloadable (due to their internal structure, its a jruby application). How can I tell rails to not reload these after each and every request?

Thanks!

+1  A: 

After looking at this post about adding reloadability to plugins, I think what you could try doing is adding the file your class resides in to ActiveSupport::Dependencies.load_once_paths

Add something like this in config/environments/development.rb:

ActiveSupport::Dependencies << (Rails.root + "lib/your_class.rb").to_s

The trade off is that you will need to restart your script/server process every time you change one of the files.

BaroqueBobcat
Sounds perfect, will try that out tomorrow!
reto