Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9153631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:18:16+00:00 2026-06-17T12:18:16+00:00

I am having problems deciding on model names for a new app I am

  • 0

I am having problems deciding on model names for a new app I am building. These are important decisions so I want to make sure to do it right. This is going to be a database to hold medical records, so there can be records on people receiving medical services, their family members, doctors, nurses/administrative staff, witnesses to accidents, etc.

Instead of having a specific table for every type of person, I am thinking about just making ‘People’ and ‘User’ models. The ‘User’ model would hold all individuals who work for the health facility and the ‘People’ table would hold everyone else – such as patients and witnesses to accidents.

I still have a problem, because if a user documents an accident, one ‘User’ could be the witness and another could be the victim. It basically makes my app seem inflexible becuase I am separating ‘People’ (patients,etc) and ‘Users’ (employees, etc) into two constant places in the system.

So, why can’t I just make one table called ‘People’ for everyone? Then, a person could be a user, employee, doctor, patient, victim – or any combination of them.

Have we been taught to always name the people who work for us and login to the system ‘Users’? Does this matter?

Is there any negative to having a table called ‘Person’ for everyone? It seems to make things a little easier. Any person can be a user (by having a valid login/status enabled to login) or a non-user. I don’t see a negative to this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:18:17+00:00Added an answer on June 17, 2026 at 12:18 pm

    You and I are always people but we play specific roles in certain circumstances–so what about a setup where all people are represented by a model called “Person”, and are linked to by the specific classes that require those roles. For instance:

    class Person < ActiveRecord::Base
      ...
    end
    
    class HospitalEmployee
      belongs_to :user, class_name: 'Person' # foreign key is user_id
    end
    
    class MedicalRecord < ActiveRecord::Base
      belongs_to :patient, class_name: 'Person' # foreign key is patient_id
      ...
    end
    
    class Accident < ActiveRecord::Base
      belongs_to :victim, class_name: 'Person' # foreign key is victim_id
      belongs_to :witness, class_name: 'Person' # foreign key is witness id
    end
    

    In this way, the data that makes up what a person is is always constant, but the data that makes up the roles they play are stored in other models.

    You’ll find this sort of setup often in the wild–for example, at a college I worked at, all records dealing with individuals pointed back to a master “PEOPLE” file–students that later became employees used the same record in the PEOPLE file in both instances.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep having problems deciding how I should create my classes internally. Initially I
I'm having problems with deciding where to store files uploaded by user in my
Having problems creating radio buttons in a form using has_one Model Class User has_one
I'm having problems deciding on what is the best way is to handle and
I'm new to databases and mysql. I'm having a difficult time even deciding exactly
Having problems with out of scope for NSDate in an iphone app. I have
I'm having a problem deciding when to create a new controller and which controller
Having problems with a small awk script, Im trying to choose the newest of
Having problems iterating. Problem has to do with const correctness, I think. I assume
Having problems with the combining of two statements in a controller. Both statements work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.