I have a habtm relation (<assignments_candidates>)
I want to remove one candidate from the job. here is my code so far
@assignment = Assignment.find(:first, :joins => :candidates, :select => "assignments_candidates.*", :conditions => ["assignments_candidates.candidate_id = ? AND assignments_candidates.assignment_id = ?", params[:candidate_id], params[:assignment_id]] ) @assignment.destroy
At the moment, all I think is that it destroys the object, not the entry in the intersection table
any ideas?
Thanks, Alex
source share