EppO/rolify — Issue #20: Class caching in development
Author: scottkf
Created: 2011-11-02 20:31:28+00:00
State: open

I was getting AssociationTypeMismatch errors from this code: https://github.com/EppO/rolify/blob/master/lib/rolify/role.rb#L30-38

I'm not quite sure why (the user of the @@role_cname?) it would be reloading the class if I wasn't touching it, but it did nonetheless. My solution was to change

```ruby
self.roles << role
```

to

```ruby
self.role_ids |= [role.id]
```
It would update fast enough so the class would be the same.