Suppose i have three tables user,projects,user_projects.
their attributes are:
tablename attributes:
1)user id(pk),name,email,password
2)projects id(pk),projectname,start_date,end_date
3)user_projects id(pk),user_id,project_id
their relationship are
user:
has_many:user_projects
has_many:projects,:through =>:user_projects
projects:
has_many:user_projects
has_many:users,:through =>:user_projects
user_projects:
belongs_to :user
belongs_to :project
suppose i want
@users=User.find(:first,:condition=>["name=?","James"])
@[email protected](:all,:condition=>["projectname=?","temp"])
but this will all project related to user name james…
but the condition inside(@users.projects) is not executed,i am
unable to get the information of projectname temp in which
james works…
pls provide some code how i give condition inside it.
pls help immediately