5

I've searched fairly extensively for any advice and have yet to find it so, here goes:

My Rails project fails to automatically reload models in development. Reloading them currently requires a full server restart.

Previous instances of this issue have been related to non-activerecord files placed in the models directory, though this is not the case for me.

config.cache_classes is properly set to false in my development config file. Views and controllers reload without issue.

All of my rails components are version 3.2.11. I have tried disabling all of my development-specific gems to no avail. This is obviously not a productivity stopper, but it is quite an annoyance. Any help appreciated and I am happy to provide more information if it would help, though I am not using any exotic gems.

Thanks!

fredugolon
  • 518
  • 3
  • 9

2 Answers2

1

Some possibilities:

  1. You are not really running on developement environment
  2. You are changing a model within a namespace and didn't told rails to autoload the path
  3. You are changing a file that is included in your class, not your class directly (or any of the many variants for this)
  4. You are caching classes

Considerations:

  1. Things might change according to the webserver you are using
fotanus
  • 19,618
  • 13
  • 77
  • 111
  • I know (4) is not your case, just add for sake of completude – fotanus Jun 05 '13 at 17:49
  • Thanks for the prompt reply. Unfortunately, none of those options are the case. I've verified, for sanity, that `Rails.env.development?` is true. My models are not namespaced (controllers are, but work fine). I am altering my model classes directly and caching is turned off :( I am using the thin webserver in development, though that is the standard. Edited just to say: Still hunting! – fredugolon Jun 05 '13 at 18:08
0

How do you know it's not reloading?

I ask my question because I was having the exact same issue when I was trying to insert a debugger into what I thought was a piece of code that was being executed. I assumed the model wasn't being reloaded since it was not hitting the debugger but it was actually a call back that was redirecting me around the code with the debugger line in it.

So, it might be something other than your models not being reloaded.

Joshua Pinter
  • 45,245
  • 23
  • 243
  • 245