Yes, it will just do something like this:
class User < ActiveRecord::Base
has_and_belongs_to_many :roles
# Include default devise modules. Others available are:
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable
and :oauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
end
##############################
class OtherUser < User
before_create :setup_role #this is not part of Devise
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
attr_accessible :email, :password, :password_confirmation, :remember_me
def setup_role
if self.role_ids.empty?
self.role_ids = [6]
end
end
end
##############################
class EndUser < User
before_create :setup_role
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
attr_accessible :email, :password, :password_confirmation, :remember_me
def setup_role
if self.role_ids.empty?
self.role_ids = [5]
end
end
end
##############################
Depending on what you want to do with those, you'll need to modify
your routes file so everything matches.
For example,
devise_for :end_users, :controllers => { :registrations => "end_users/
registrations", :sessions => "end_users/sessions" }