I have a rails app with a CanCan 'role' model. Role has a "name" field, which cancan calls to determine a user's permission levels.
In Factory Girl I have a whole lot of models that associate with the 'Role' field; some many iterations deep. Eg: (The 'account' factory has an association with the 'purchase' factory, which has an association with the 'user' factory, which has an association with 'role')
The problem is, if I call two factories that end up associating with 'role', the second one called will fail uniqueness validation on that role-->'name' field. Normally uniqueness validations aren't an issue - I just set the problematic attribute to a sequence...but I can't do that here - the name of the role has to be specific for the sake of cancan functionality.
So...how do I get around this?