has_and_belongs_to_many delete

Hi all,

I have a has_and_belongs_to_many relationship with 2 tables (users -
users_teams, teams)

Can I delete a user from a team with 1 function? I now first delete
the user from users_teams and then from teams. Can't this be done with
one method?



Hi, thanks for the reply

Though I still don't get it to work

When I do
    team = Node.find(teamid)
    user = User.find(userid)

ActiveRecord only deletes records in the users_teams table and not
users table. Is this not possible with 1 function?