How to handle an ActiveRecord model where only some of the model instances are users?

I’m looking for recommendations on how to handle a scenario where some instances of an ActiveRecord object are Users of the system and some are not.

For example, I have a class called GeneralPractitioner. Some GeneralPractitioners will come to the app, register themselves and become credentialed users of the app, while other GeneralPractitioners will be added to the system (by an admin user) and will not themselves become users. Not all GeneralPractitioners are users.

I am considering using Devise for authentication, but I am open to other options.

You could add a belongs_to :general_practioner association to your user model. That will have a foreign key general_practioner_id which will either be null or the id of a GeneralPractioner.

(or you could do it the other way around, with a belongs_to :user association on the GeneralPractitioner class).