# Depricated Controller Method :model

**URL:** <https://www.ruby-forum.com/t/depricated-controller-method-model/69447>\
**Category:** Rails\
**Created:** [September 21, 2006, 3:52am UTC](https://www.ruby-forum.com/t/depricated-controller-method-model/69447 "2006-09-21T03:52:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![liquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/47e85d/32.png) [@liquid](https://www.ruby-forum.com/u/liquid)\
**Post date:** [September 21, 2006, 3:52am UTC](https://www.ruby-forum.com/t/depricated-controller-method-model/69447/1 "2006-09-21T03:52:23Z")

</div>

Hi everyone,

I’ve just found out that the :model method in ActionController is now  
depricated. According to the source it suggests that it is now taken  
care  
of via ActiveSupport.

Can anyone tell me the equivelant method in ActiveSupport? I’ve had a  
look  
and the candidates for what I think is equivelant are

:depend\_on  
:associate\_with (a wrapper around :depend\_on)  
:require\_or\_load

I’m leaning toward :depend\_on can someone confirm or point me in the  
right  
direction please?

I’ve also noticed that with these methods multiple models can no longer  
be  
specified in a single call.

Any help would be great.

Cheers

Daniel

---

<div class="post-metadata">

**Author:** ![liquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/47e85d/32.png) [@liquid](https://www.ruby-forum.com/u/liquid)\
**Post date:** [September 21, 2006, 8:16am UTC](https://www.ruby-forum.com/t/depricated-controller-method-model/69447/2 "2006-09-21T08:16:52Z")

</div>

On 2006-09-20, at 22:47 , Daniel N wrote:

> Hi everyone,
> 
> I’ve just found out that the :model method in ActionController is  
> now depricated. According to the source it suggests that it is now  
> taken care of via ActiveSupport.
> 
> Can anyone tell me the equivelant method in ActiveSupport? I’ve  
> had a look and the candidates for what I think is equivelant are

There’s no method in active\_support. What the deprecation means is  
that if you reference a constant, say, Post and it’s undefined, then  
rails will try to load post.rb, and expect it to define Post.

So it’s all automagic now.

---

<div class="post-metadata">

**Author:** ![liquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/47e85d/32.png) [@liquid](https://www.ruby-forum.com/u/liquid)\
**Post date:** [September 21, 2006, 8:22am UTC](https://www.ruby-forum.com/t/depricated-controller-method-model/69447/3 "2006-09-21T08:22:54Z")

</div>

On 9/21/06, Caio C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Can anyone tell me the equivelant method in ActiveSupport? I’ve  
> > had a look and the candidates for what I think is equivelant are
> 
> There’s no method in active\_support. What the deprecation means is  
> that if you reference a constant, say, Post and it’s undefined, then  
> rails will try to load post.rb, and expect it to define Post.
> 
> So it’s all automagic now.

The main reason that I used the :model method was if I was storing  
objects  
in the session.

Does the automagic happen with re-constituded objects from the session?

Thanx for the reply

---

<div class="post-metadata">

**Author:** ![liquid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/47e85d/32.png) [@liquid](https://www.ruby-forum.com/u/liquid)\
**Post date:** [September 21, 2006, 10:45am UTC](https://www.ruby-forum.com/t/depricated-controller-method-model/69447/4 "2006-09-21T10:45:07Z")

</div>

On 2006-09-21, at 03:19 , Daniel N wrote:

> The main reason that I used the :model method was if I was storing  
> objects in the session.
> 
> Does the automagic happen with re-constituded objects from the  
> session?

I don’t really know. I often disrecommend storeing ARs in the session  
(store the id instead)

Try without model and let’s see how it goes.
