Hello, welcome to the Airbnb app with only the models ! This is an exercice where you will learn how to make robust models.
There should be four models :
User
City
Listing
Reservation
Stack for tests include :
- Rspec
- Factory_bot
- nyan-cat-formatter
- shoulda_matchers
To run the tests : $ rspec
- phone
- description
can have many : flats, bookings
- beds
- price
- descrition
- wifi (bool)
belongs to : user, city
- start_date
- length
belongs to : user, flat
has many : flats
- flat can only be booked by one user at a time (disponibilité)
- user cannot book his own flat?