0
I’ll try to be brief in my doubt.
How can I model a class scheme that gives me some questions: This I will do in Rails 4.1, using Activerecord as ORM acting in Mysql.
I’ll have an entity Person
which will have a reference (object), to my model of Product
, that is, none or many products, the case is that this will be the repository of the company, ie, all customers will have a unique registration that when logged in, check the products available to that user, which marries several products with different properties relating to a product.
For example :
Product A will have attributes:
- color
- size
- heaviness
Product B will have attributes:
- time remaining
- numero_serie
The question is this how can I model this data abstraction?
I’ve been thinking, every new product we develop, we’d have to create a new class and add to that?
summing up again...
How to create an entity relationship where each product will have its own attributes? and a user can have multiple products?
It is all the same doubt, if I was not clear please ask me to edit the question! thank you from now!
What you want is a relationship Many-to-Many? That is: the products will be shared between users or each product will belong to one user?
– user7261
The second option, a user may have multiple products, but these products will not have a standard.
– Bruno Casali