Closed Ajitkumar-P closed 6 years ago
I thought I was having this problem. But, turns out I was calling destroy
on the Role
instance itself.
Make sure you are removing the association only by running user.remove_role :x
.
Set the configuration remove_role_if_empty
to false
to avoid this scenario
user.add_rold :admin user.remove_role :admin
deleted the assigned role in the user_role joint table but also delete the role from role table.