martinrehfeld/role_model — Issue #12: roles not persisting
Author: blueblank
Created: 2011-11-02 15:08:17+00:00
State: open

I'm using this without CanCan or DeclarativeAuthorization

I just plugged this into my user model:

include RoleModel
attr_accessor :roles_mask
roles_attribute :roles_mask
roles :domain_admin, :domain_user, :default

I can get User.valid_roles, but I can't set roles properly...they disappear after saving.

I tried adding a role on user creation

after_create :set_role
private
def set_role
self.roles = ['default']
end

but the role does not get set

tl;dr seems to be there but I can't actually set and persist roles...reverting to

> u.roles
User Load (0.6ms) SELECT "users".* FROM "users" ORDER BY "users"."id" DESC LIMIT 1
=> #

Just following the basic readme on the front of this gem