# Turn off model pre-loading in production environment?

**URL:** <https://www.ruby-forum.com/t/turn-off-model-pre-loading-in-production-environment/169023>\
**Category:** Rails\
**Created:** [May 28, 2009, 3:25pm UTC](https://www.ruby-forum.com/t/turn-off-model-pre-loading-in-production-environment/169023 "2009-05-28T15:25:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![simonsaid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5e925/32.png) [@simonsaid](https://www.ruby-forum.com/u/simonsaid)\
**Post date:** [May 28, 2009, 3:25pm UTC](https://www.ruby-forum.com/t/turn-off-model-pre-loading-in-production-environment/169023/1 "2009-05-28T15:25:29Z")

</div>

Hello,

How can i turn off model pre-loading in production environment so that  
the app loads the code the exact same way as in the development  
environment? Thanks!

---

<div class="post-metadata">

**Author:** ![simonsaid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5e925/32.png) [@simonsaid](https://www.ruby-forum.com/u/simonsaid)\
**Post date:** [May 28, 2009, 3:42pm UTC](https://www.ruby-forum.com/t/turn-off-model-pre-loading-in-production-environment/169023/2 "2009-05-28T15:42:01Z")

</div>

Or how can i preload a controller at startup? Or make sure the  
controller loads before the models…

---

<div class="post-metadata">

**Author:** ![simonsaid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5e925/32.png) [@simonsaid](https://www.ruby-forum.com/u/simonsaid)\
**Post date:** [May 28, 2009, 4:05pm UTC](https://www.ruby-forum.com/t/turn-off-model-pre-loading-in-production-environment/169023/3 "2009-05-28T16:05:00Z")

</div>

Preload the controller? Could you please give an example

---

<div class="post-metadata">

**Author:** ![simonsaid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5e925/32.png) [@simonsaid](https://www.ruby-forum.com/u/simonsaid)\
**Post date:** [May 28, 2009, 8:52pm UTC](https://www.ruby-forum.com/t/turn-off-model-pre-loading-in-production-environment/169023/4 "2009-05-28T20:52:24Z")

</div>

Ok i was able to run the production env as development by changing  
stuff in config/environments/testing.rb so its ok now

---

<div class="post-metadata">

**Author:** ![simonsaid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b5e925/32.png) [@simonsaid](https://www.ruby-forum.com/u/simonsaid)\
**Post date:** [May 28, 2009, 4:26pm UTC](https://www.ruby-forum.com/t/turn-off-model-pre-loading-in-production-environment/169023/5 "2009-05-28T16:26:54Z")

</div>

In the dev env, when i go to the localhost from the browser (i use  
[testing.site.com](http://testing.site.com), i changed the hosts settings), first the weborb code  
is loaded and then the code in the models is loaded. But in the  
production env it is the other way around, when i go to  
[testing.theprodsite.com](http://testing.theprodsite.com), first the model files are pre-loaded and then  
the controllers are loaded but i need to use the request function  
available only in the controller and i need the function before the  
models are loaded… lemme know if its still unclear. Thanks!
