Database migration to change frienships.status to an integer column. If status is '0', user_id has invited friend_id but has not been accepted. if status is 1, friendship has been accepted. If friend_id extends invite to user_id before accepting the previous invite, friendship is automatically accepted. Also some tweaks and refactoring for more concise names and more comments (sessions_helper.rb, users_controller.rb)