Closed BrentBarnes closed 2 years ago
First Association draft between Airport and Flight
<> Airport Model airport_code has_many :departing_flights, class_name: "Flight" has_many :arriving_flights, class_name: "Flight"
<> Flight Model departure_airport_id arrival_airport_id start_datetime flight_duration belongs_to :departure_airport, class_name: "Airport" belongs_to :arrival_airport, class_name: "Airport"
Should make these console commands work
Airport.first.departing_flights Airport.first.arriving_flights
Flight.first.departure_airport Flight.first.arrival_airport
Is it a has_many through or is it has_many belongs_to?