Hello, I am a beginner in Rails, (setting up my first system) and I have two doubts about relationship between tables:
1.) I have a Line template with the source and destination attributes that should reference another Local , ie Line has a source attribute that is a local and another destination attribute that is another location, how do I make this association?
2.) Line represents a route between one place and another. In addition to the points of origin and destination, the line passes on several waypoints when it is going (origin> destination), and so many when it is returning (destination> origin). Each reference point of this is a "referenced" location, which in addition to the attributes inherited from Location must have a "distance" information, ie Line, Direction One, after 20 minutes it passes in Location x.
Looking at the relationship between the objects (if you facilitate the understanding would have something like this):
- Location {description: string}
- Extends Reference Local {distance: integer}
- Line {source: Local, destination: Local, referencesID: [Reference], referencesVolt: [References]}
More like creating the templates to represent this? bold text