From: Toby O'Rourke Date: 2007-09-08T06:59:53+09:00 Subject: enforce mutual exclusivity Hi, First post, sorry if this is the wrong place or has been answered before. I'm using ActiveRecord and I want to enforce mutual exclusivity on a has_and_belongs_to_many. A concrete example: I have a User which can have one or more Roles (student, tutor, headmaster, administrator etc). However if a user is a student they cannot hold any other role. I was hoping to find something like validate_exclusive but that doesn't appear to exist. Can anyone suggest how I can implement this. Otherwise, is there a better pattern I could use to model this? Many thanks, Toby.