-
Notifications
You must be signed in to change notification settings - Fork 405
EppO edited this page Apr 2, 2012
·
28 revisions
If you have 2 different User
classes, let's say User
and AdminUser
, yes it is.
To make it work, you need 2 Role
classes (Role
and AdminRole
), so 2 tables in the database (so 2 migration files if you use ActiveRecord). To make it easier, just run the generator twice:
rails g Rolify:role
rails g Rolify:role AdminRole AdminUser
In User
class, you just have to put rolify
method in it
In AdminUser
class, you would add: rolify :role_cname => "AdminRole"
to make it work