1
- Assuming a project in Rails with the models Livestock, Agriculture, Piscicultura e Benfeitoria.
- These inherit the properties of a model called Activity and are considered types of activity.
- Models do not accurately inherit specific methods or behaviors, in the case of access only to the inherited properties
- But some models have properties beyond the inherited and others no, for example Agriculture , beyond the inherited, has the Grupoagricola properties and Tipodeagriculture.
Bearing this in mind comes my doubts: Is it a favorable scenario for the use of the STI (Single Table Inheritance) technique? 2nd In the case of models that have only inherited properties, there is how to avoid creating a new table or persistence model?.
Have you tried modeling with composition instead of Heritage?
– Bruno Casali