After having defined a has_many :through relationship,
@user = User.New(:name=>"Bob")
@project = Project.New( :name=>"Market Survey")
@user.projects << @project
Is there an easy way to fetch the new intermediate object it creates? such as in the above example, if the intermediate table is `memberships' then I could use:
@membership = @user.projects << @project
I have this feeling that there must be a better way of doing this than what we do all the time, i.e
@membership = Membership.where(:user_id=>x , :project_id=>y).first