Retrieving object from a user

Hi,

I would like which is the best way to implement this:
I have an application with invoices, lines, accouts, etc… lots of
models. Each element of a model belongs to a different user so when a
user is logged he will see only his elements. I can implement this
adding in all the find methods the condition :user_id =>
params[:user_id].

But, is there any other way that automatically adds this condition to
all the queries if a user is logged in?

On Fri, Oct 2, 2009 at 12:27 PM, Juan K.
[email protected] wrote:

But, is there any other way that automatically adds this condition to
all the queries if a user is logged in?

Have you defined relationships between those models?


Leonardo M…
There’s no place like ~

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs