I highly recommend using single page inheritance (STI). You can do STI by adding a column named type with type string in the users table and create the admin model as well as the normal_user model, both models inherit the devise gem user model.
class NormalUser < User end class Admin < User end
The type column is a reserved word that will contain the NormalUser or admin value in accordance with the user type you created.
To create an administrator, use Admin.create(...) and to create a normal user, NormalUser.create(...) , where the dots are the admin and NormalUser
mohamagdy Feb 26 2018-12-12T00: 00Z
source share