I have model Offer
with many fields, among which are there are two fields that relate to the same model:
# == Schema Information
#
# Table name: offers
#
# id :integer not null, primary key
# name :string(250) default(""), not null
# destination_id :integer not null
# cruise_line_id :integer not null
# ship_id :integer not null
# departure_date :date not null
# departure_port_id :integer
# arrival_date :date not null
# arrival_port_id :integer
departure_port_id
and arrival_port_id
relate to the same model Port
, but can be also NULL
, if no departure or arrival port provided.
How should Offer
and Port
models look like in this case?