Hi, my first question, and probably a newbish one:
So I have a projects model, which belongs to a user :through an
has_many :projects, :through => :assignments
has_many :users, :through => :assignments
Now I want in the startpage (home controller), after logging in, see
all the projects assigned to the current user.
How do I wwrite that query?
I have assignments like
@assignments = Assignment.where(“user_id = ?”, current_user.id)
but if I try the same thing with projects I get an error… as there
is no user_id column in projects…
there must be an elegant way to query this with Active Record, right?
thanks in advance