yev2000/myflix — pull request #7 by yev2000 (2014-11-11 22:47:23+00:00)
Title: Social networking

This is the code to implement the social networking features. I called the primary relationship class "Following". So there are many "Followings" in the system with each following having a follower and a leader.

I created getter methods on the User class to get access to a user's followers and the leaders that the user follows.

There was some minor code cleanup based on comments of the prior TDD project review (e.g. I renamed the current_user_get method to current_user), unrelated to specific social networking features.

The biggest question in terms of my approach was my design decision to have the create path for the Following be a member of the User resource. So instead of it being a URL like a post to /followings, it actually is a post to /users//followings. I would like feedback on this approach. As a result of me doing it this way, I implemented the "Follow" link on a user's "show" page as a form so it had a form_for([@user, @following]) type of construct -- you will see that in the show.html.haml for the user.