JohnsCurry/thirdcourse — pull request #2 by JohnsCurry (2014-07-27 20:45:27+00:00)
Title: Week two half-way point

Hi, please take a look specifically at reviews_controller.rb. I left my original code prior to the solutions in the code intentionally to get some feedback. Turns out I had forgotten to put the belongs_to :user in my review.rb and thats why my @review = @video.reviews.build(review_params.merge!(user: current_user))
line would not work. But now I'm thinking that since I have the belongs_to :user, won't the entire hash of the user be associated with the review just because of the user_id stored in the reviews table? In case it's not clear, won't my commented lines of code:

#@review = @video.reviews.build(review_params)
#@review.user_id = current_user.id
accomplish the same thing as:
@review = @video.reviews.build(review_params.merge!(user: current_user))

I'm assuming if so, then the true benefit is accomplishing the same thing in one line of code vs two lines of code?