Field Trip is an app that allows a user to see airlines, flights, and passengers.
- Airlines have many flights
- flights belong to airlines
- Flights have many passengers
- Passengers can have many flights
- Airlines have a name
- Ex: name: “Frontier”
- Flights have a number, date, time, departure city, and arrival city
- Ex: number: “1727”, date: “08/03/20”, departure_city: “Denver”, arrival_city: “Reno” -- for this app, it does not matter how you format the flight’s date
- Passengers have a name and age
- Ex: name: “Joe”, age: 7
User Story 1, Flights Index Page
As a visitor
When I visit the flights index page
I see a list of all flight numbers
And under each flight number I see the names of all that flight's passengers
User Story 2, Airlines Show Page
As a visitor
When I visit an airlines show page
I see a unique list of passengers that have flights from that airline
User Story 3, Remove a Passenger from a Flight
As a visitor
When I visit the flights index page
Next to each passengers name
I see a link to remove that passenger from that flight
When I click on that link
I'm returned to the flights index page
And I no longer see that passenger listed under that flight
Extension Story, Flights sorted by passenger count
As a visitor
When I visit the Flight index
Then I see that flights are ordered by the number of passengers on the flight from most passengers to least
(Note: you should not make a separate query for each flight to calculate the number of passengers)