After basing my first project on my love of Star Wars, I decided to base the second, the Sinatra project, on another thing close to my heart, my cats. My wife and I have two, Bronx and Coco Villanelle. They’re not related, but they act like young siblings—one moment, they’re cozying up to one another on the bed; the next, we’ll find them roughhousing like little wrestlers.
My wife and I travel quite a bit, so we often have to find temporary homes for Bronx and Coco Villanelle, and we use a service that schedules everything through phone calls and emails—a little outdated in today’s app-dominated world. With that in mind, I decided my project would be a pet-sitting scheduler app!
Models
Ok, let’s take a look at what kind of models our app will have. First, we have to have Users
, because, well, people have to be able to login and use the app! And I’m actually going to have to kinds of Users
, Owners
and Sitters
. Here, I’ve made them subclasses of Users
, because there’s a lot of functionality they share.
Next, we have Pets
. Just as in the real world, a Pet
belongs_to
an Owner
, and an Owner
has_many
Pets
. I know some people have just one pet, but they’re really missing out.
And finally, we have Appointments
. Representing scheduled pet-sitting sessions, an Appointment
belongs_to both a Pet
and a Sitter
.