Fixed has_many :through association for rating, and added upvoting, downvoting functionality