On Fri, Oct 2, 2009 at 12:27 PM, Juan Kinunt <[email protected]> wrote: > > 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? > --
Have you defined relationships between those models? -- Leonardo Mateo. There's no place like ~ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

