I want to create a base model Person with some person related attributes like name, address, phone and so on. A Person should be one ore more of the following:
LoginUserwith fields for login, password, last_login, ...CardHolderwith fields for card_id, last_entrance, ...Supplierwith just a flag whether or not the person is a supplierRecipientwith just a flag whether or not the person is a recipient
What's the right design pattern in Ruby on Rails to represent that inheritance? How it should be represented in the model(s) and table structure so that it is possible to check whether a Person is a LoginUser and to access the corresponding fields. In another project I worked already with STI but in this case this isn't the right pattern.
Aucun commentaire:
Enregistrer un commentaire