yev2000/myflix — pull request #3 by yev2000 (2014-10-20 19:53:36+00:00)
Title: Video reviews

This is the proposed implementation for allowing users to review videos. Includes test code for model changes to User and Videos to support associations with Reviews, as well as the Review model itself. Also implemented are the changes to the Video controller to allow posting of reviews, and associated controller test code.

Some implementation/design decisions:
* placed processing of POST in the video controller rather in separate reviews controller.
* A user cannot review the same video more than once.
* A user is allowed to review a video without rating it (stored as a 0 rating internally).
* Video show page displays the average rating of the video, calculated from its associated reviews. Average rating calculation is smart to ignore all unrated reviews so that they don't affect the average.
* In the show video page, the review entry form is hidden if the currently logged in user has already reviewed the video. (This can be improved in terms of user experience by calling out the review that the user has written in a separate color or background to highlight it - but that's not implemented).