Adding State

Adding State

It is important to be able to respond to different events in our friendship model. For example, when a user sends a friend request to another user, we want the requestee to get an email. We're going to use something called a state machine to manage this.

Extra Credit

Try converting the state machine to use an integer instead of a string for the state field. This is going to involve creating a migration as well as significantly modifying your code.