Depricated Controller Method :model

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

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

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.