Authentication - Devise Authorization - CanCan, Rolify
I have a single User model in Devise combined with CanCan and Rolify to set roles and abilities. This works ok but starts to get complicated due to the first requirement below. I'm not sure that 'roles' is the best way to differentiate these accounts since they have a very different field set and abilities.
Would it be better to have different Devise models for the three user types? (This is complicated by the second requirement.) Or is it best practice to keep all users in one model and assign roles and abilities as I'm doing now?
Requirements:
I've looked at several answers on here regarding the specifics of achieving either of these methods but I'm looking for advice on which method is more suited to my application. Am I putting too much in Devise? I realise it's only an authentication framework. Should I have a separate User model for personal attributes?
As if you can't tell - I'm new to this and still trying to get the concepts.
One suggestion would be to keep things as simple as possible with Devise and manage the roles by a single string field in the User model. Then you only have one field to check for authentication, and you can make 2 other separate models for the other attributes required by Teacher and Student as they will be easy to access with Rails' helpers (belongs_to etc).