I am a beginner in Ruby on Rails.
I would like to make the following database model:
Package (has_many packagelines)
Packageline (belongs_to package)
The package line can be one of 3 things: entity, item or service, so I
would like to have a line type with the options entity, item or service.
I also want a field where I store the foreign key. The problem is that
the foreign key is dependent on what is selected in the line type field.
Can somebody tell me how I can manage this.