I am newbie on RoR and I am wondering how to solve the following
situation using “has_x” and “belongs_to” (and eventually polymorphism
Let say that I have a Salesman table containing salesmen
Let say that I have a Customer table containing customers
information and a prefered Salesman (salesman_id)
Let say that I have an Order table, orders are linked to customers
(the order “belongs to” a customer) and to salesmen (the order have
been managed by a particular salesman (salesman_id) which is not
necessary the customer prefered salesman).
Could someone explain me how to declare models and tables (keys) so
that those relationships are working ?
Many thanks for your help!