# Models without model?

**URL:** <https://www.ruby-forum.com/t/models-without-model/79346>\
**Category:** Engines\
**Created:** [December 14, 2006, 1:17pm UTC](https://www.ruby-forum.com/t/models-without-model/79346 "2006-12-14T13:17:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Nelson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@James\_Nelson](https://www.ruby-forum.com/u/James_Nelson)\
**Post date:** [December 14, 2006, 1:17pm UTC](https://www.ruby-forum.com/t/models-without-model/79346/1 "2006-12-14T13:17:31Z")

</div>

Hi people

I’m a complete new to rails, so sorry in advance for the stupid  
questions  
that I invariable will ask. I’m hoping that this one isn’t one of such  
questions 🙂

While looking through my logs, i’ve found the following statement a few  
times:

DEPRECATION WARNING: model is deprecated and will be removed from Rails  
2.0  
See [http://www.rubyonrails.org/deprecation](http://www.rubyonrails.org/deprecation) for details.

However, i’m finding that I need to explicitly call model for each of my  
models which are contained in the engine i’m building. At the moment  
they’re  
being mixed into the ApplicationController so that everything can use  
the  
models. Am I doing something wrong, or is this a known problem?

---

<div class="post-metadata">

**Author:** ![James\_Nelson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@James\_Nelson](https://www.ruby-forum.com/u/James_Nelson)\
**Post date:** [December 15, 2006, 12:48pm UTC](https://www.ruby-forum.com/t/models-without-model/79346/2 "2006-12-15T12:48:33Z")

</div>

So if you don’t include the ‘model’ directive then your controllers  
can’t load your models? Is that right?

Can you load them automatically from the console? (i.e. without a  
‘require’ statement)

- James

---

<div class="post-metadata">

**Author:** ![James\_Nelson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@James\_Nelson](https://www.ruby-forum.com/u/James_Nelson)\
**Post date:** [December 15, 2006, 3:44pm UTC](https://www.ruby-forum.com/t/models-without-model/79346/3 "2006-12-15T15:44:58Z")

</div>

This problem actually turned out to be related to the problem in my  
other  
e-mail with the controllers not loading. Before I changed engines.rb to  
modify Dependencies.load\_paths as well, they would not load  
automatically in  
the console (and i’m presuming in a controller as well), but after the  
fix  
they would load automatically. Before the fix tho, they would still load  
if  
you specifically said model :user, or etc.

My 2 cents is that $LOAD\_PATH is only being used if you specifically ask  
it  
to load something, while Dependencies.load\_paths is being used for  
automatic  
loading. However, the first time I knew what any of those two variables  
did  
was about an hour ago (and I still don’t really understand it), so take  
that  
for a grain of salt.

---

<div class="post-metadata">

**Author:** ![James\_Nelson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@James\_Nelson](https://www.ruby-forum.com/u/James_Nelson)\
**Post date:** [December 15, 2006, 3:51pm UTC](https://www.ruby-forum.com/t/models-without-model/79346/4 "2006-12-15T15:51:00Z")

</div>

OK - let’s drop this thread and focus on the other one. I’ll reply in  
more detail there.
