# Rails Development Environment and Reloading Models

**URL:** <https://www.ruby-forum.com/t/rails-development-environment-and-reloading-models/106862>\
**Category:** Rails\
**Created:** [June 14, 2007, 8:02pm UTC](https://www.ruby-forum.com/t/rails-development-environment-and-reloading-models/106862 "2007-06-14T20:02:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [June 14, 2007, 8:02pm UTC](https://www.ruby-forum.com/t/rails-development-environment-and-reloading-models/106862/1 "2007-06-14T20:02:25Z")

</div>

Hi,

By default, rails reloads all your models, while in development mode,  
with  
each new request. Is there anyway to specify that a given model, or  
models,  
should not be reloaded? This is specific to rails 1.2.3

Thanks,  
Steven

---

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [June 14, 2007, 8:13pm UTC](https://www.ruby-forum.com/t/rails-development-environment-and-reloading-models/106862/2 "2007-06-14T20:13:27Z")

</div>

As far as I know there is only a way to disable reloading in general.  
Why would you need it to be selective? Are you patching the class in  
a way that is being undone? I am patching several classes and this  
has not appeared to be an issue to date. The only issue has been when  
I modify the patches themselves and I need to restart the server to  
get environment.rb to be processed again (where some of my patches are  
loaded).

Michael

---

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [June 14, 2007, 9:02pm UTC](https://www.ruby-forum.com/t/rails-development-environment-and-reloading-models/106862/3 "2007-06-14T21:02:40Z")

</div>

Thanks for responding Michael (^\_^)

The reason I need specific classes to be reloaded has to do with a  
plugin  
I’m working on. The plugin defines classes on the fly based on info from  
a  
few db tables–I know this is probably not the best of solutions…  
Anyway,  
I’m running into problems when rails reloads these particular models.  
Everything works find in production mode, but in dev mode I keep getting  
const\_missing errors as rails can’t find the definitions for my  
“dynamic”  
classes after a reload.

I did find a work around however. If you stick stuff in the lib  
directory  
of your app, then it gets loaded only once, regardless of the  
environment.

Regards,  
Steven
