many to many relationship and update problem

I solved the problem. Yeah I am stupid
Here is the code snippet which solved the problem I had.

      @user.roles.delete(@old_role)

      @user.roles<<@new_role

Nam Kim wrote: