{"action":"created","comment":{"url":"https://api.github.com/repos/Dodie324/la_breakable/pulls/comments/28271601","id":28271601,"diff_hunk":"@@ -0,0 +1,42 @@\n+class ReviewsController < ApplicationController\n+  before_action :authenticate_user!\n+\n+  def edit\n+    @sitter = User.find(params[:sitter_id])\n+    @review = @sitter.reviews.find(params[:id])\n+  end\n+\n+  def create\n+    @sitter = User.find(params[:sitter_id])\n+    @review = Review.new(review_params)\n+    @user_review = UserReview.new(review: @review, user: current_user)\n+    @sitter_review = UserReview.new(review: @review, user: @sitter)\n+\n+    if @review.save && @user_review.save && @sitter_review.save\n+      flash[:notice] = \"Review added successfully.\"\n+      redirect_to sitter_path(@sitter)\n+    else\n+      @errors = @review.errors.full_messages\n+      render \"sitters/show\"\n+    end\n+  end\n+\n+  def update\n+    @sitter = User.find(params[:sitter_id])\n+    @review = Review.find(params[:id])\n+\n+    if @review.update(review_params)\n+      flash[:notice] = \"Review updated!\"\n+      redirect_to sitter_path(@sitter)\n+    else\n+      @errors = @review.errors.full_messages","path":"app/controllers/reviews_controller.rb","position":32,"original_position":32,"commit_id":"ad5fdce8a56131665e29dd544b6a58cf76bc47b6","original_commit_id":"ad5fdce8a56131665e29dd544b6a58cf76bc47b6","user":{"login":"omidbachari","id":6855810,"avatar_url":"https://avatars.githubusercontent.com/u/6855810?v=3","gravatar_id":"","url":"https://api.github.com/users/omidbachari","html_url":"https://github.com/omidbachari","followers_url":"https://api.github.com/users/omidbachari/followers","following_url":"https://api.github.com/users/omidbachari/following{/other_user}","gists_url":"https://api.github.com/users/omidbachari/gists{/gist_id}","starred_url":"https://api.github.com/users/omidbachari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omidbachari/subscriptions","organizations_url":"https://api.github.com/users/omidbachari/orgs","repos_url":"https://api.github.com/users/omidbachari/repos","events_url":"https://api.github.com/users/omidbachari/events{/privacy}","received_events_url":"https://api.github.com/users/omidbachari/received_events","type":"User","site_admin":false},"body":"No need to create an assignment here in the controller. Just call `@review.errors.full_messages` in the view and display accordingly. ","created_at":"2015-04-13T19:41:06Z","updated_at":"2015-04-13T19:41:06Z","html_url":"https://github.com/Dodie324/la_breakable/pull/1#discussion_r28271601","pull_request_url":"https://api.github.com/repos/Dodie324/la_breakable/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/Dodie324/la_breakable/pulls/comments/28271601"},"html":{"href":"https://github.com/Dodie324/la_breakable/pull/1#discussion_r28271601"},"pull_request":{"href":"https://api.github.com/repos/Dodie324/la_breakable/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/Dodie324/la_breakable/pulls/1","id":33175267,"html_url":"https://github.com/Dodie324/la_breakable/pull/1","diff_url":"https://github.com/Dodie324/la_breakable/pull/1.diff","patch_url":"https://github.com/Dodie324/la_breakable/pull/1.patch","issue_url":"https://api.github.com/repos/Dodie324/la_breakable/issues/1","number":1,"state":"open","locked":false,"title":"User and Review CRUD Features and Tests","user":{"login":"Dodie324","id":9405172,"avatar_url":"https://avatars.githubusercontent.com/u/9405172?v=3","gravatar_id":"","url":"https://api.github.com/users/Dodie324","html_url":"https://github.com/Dodie324","followers_url":"https://api.github.com/users/Dodie324/followers","following_url":"https://api.github.com/users/Dodie324/following{/other_user}","gists_url":"https://api.github.com/users/Dodie324/gists{/gist_id}","starred_url":"https://api.github.com/users/Dodie324/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dodie324/subscriptions","organizations_url":"https://api.github.com/users/Dodie324/orgs","repos_url":"https://api.github.com/users/Dodie324/repos","events_url":"https://api.github.com/users/Dodie324/events{/privacy}","received_events_url":"https://api.github.com/users/Dodie324/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-13T15:38:52Z","updated_at":"2015-04-13T19:41:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e3ac2d8ade617b84817ae866bba255c4bc3a82c3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Dodie324/la_breakable/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Dodie324/la_breakable/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Dodie324/la_breakable/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Dodie324/la_breakable/issues/1/comments","statuses_url":"https://api.github.com/repos/Dodie324/la_breakable/statuses/ad5fdce8a56131665e29dd544b6a58cf76bc47b6","head":{"label":"Dodie324:basic-crud_freatures","ref":"basic-crud_freatures","sha":"ad5fdce8a56131665e29dd544b6a58cf76bc47b6","user":{"login":"Dodie324","id":9405172,"avatar_url":"https://avatars.githubusercontent.com/u/9405172?v=3","gravatar_id":"","url":"https://api.github.com/users/Dodie324","html_url":"https://github.com/Dodie324","followers_url":"https://api.github.com/users/Dodie324/followers","following_url":"https://api.github.com/users/Dodie324/following{/other_user}","gists_url":"https://api.github.com/users/Dodie324/gists{/gist_id}","starred_url":"https://api.github.com/users/Dodie324/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dodie324/subscriptions","organizations_url":"https://api.github.com/users/Dodie324/orgs","repos_url":"https://api.github.com/users/Dodie324/repos","events_url":"https://api.github.com/users/Dodie324/events{/privacy}","received_events_url":"https://api.github.com/users/Dodie324/received_events","type":"User","site_admin":false},"repo":{"id":33084478,"name":"la_breakable","full_name":"Dodie324/la_breakable","owner":{"login":"Dodie324","id":9405172,"avatar_url":"https://avatars.githubusercontent.com/u/9405172?v=3","gravatar_id":"","url":"https://api.github.com/users/Dodie324","html_url":"https://github.com/Dodie324","followers_url":"https://api.github.com/users/Dodie324/followers","following_url":"https://api.github.com/users/Dodie324/following{/other_user}","gists_url":"https://api.github.com/users/Dodie324/gists{/gist_id}","starred_url":"https://api.github.com/users/Dodie324/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dodie324/subscriptions","organizations_url":"https://api.github.com/users/Dodie324/orgs","repos_url":"https://api.github.com/users/Dodie324/repos","events_url":"https://api.github.com/users/Dodie324/events{/privacy}","received_events_url":"https://api.github.com/users/Dodie324/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Dodie324/la_breakable","description":"","fork":false,"url":"https://api.github.com/repos/Dodie324/la_breakable","forks_url":"https://api.github.com/repos/Dodie324/la_breakable/forks","keys_url":"https://api.github.com/repos/Dodie324/la_breakable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Dodie324/la_breakable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Dodie324/la_breakable/teams","hooks_url":"https://api.github.com/repos/Dodie324/la_breakable/hooks","issue_events_url":"https://api.github.com/repos/Dodie324/la_breakable/issues/events{/number}","events_url":"https://api.github.com/repos/Dodie324/la_breakable/events","assignees_url":"https://api.github.com/repos/Dodie324/la_breakable/assignees{/user}","branches_url":"https://api.github.com/repos/Dodie324/la_breakable/branches{/branch}","tags_url":"https://api.github.com/repos/Dodie324/la_breakable/tags","blobs_url":"https://api.github.com/repos/Dodie324/la_breakable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Dodie324/la_breakable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Dodie324/la_breakable/git/refs{/sha}","trees_url":"https://api.github.com/repos/Dodie324/la_breakable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Dodie324/la_breakable/statuses/{sha}","languages_url":"https://api.github.com/repos/Dodie324/la_breakable/languages","stargazers_url":"https://api.github.com/repos/Dodie324/la_breakable/stargazers","contributors_url":"https://api.github.com/repos/Dodie324/la_breakable/contributors","subscribers_url":"https://api.github.com/repos/Dodie324/la_breakable/subscribers","subscription_url":"https://api.github.com/repos/Dodie324/la_breakable/subscription","commits_url":"https://api.github.com/repos/Dodie324/la_breakable/commits{/sha}","git_commits_url":"https://api.github.com/repos/Dodie324/la_breakable/git/commits{/sha}","comments_url":"https://api.github.com/repos/Dodie324/la_breakable/comments{/number}","issue_comment_url":"https://api.github.com/repos/Dodie324/la_breakable/issues/comments{/number}","contents_url":"https://api.github.com/repos/Dodie324/la_breakable/contents/{+path}","compare_url":"https://api.github.com/repos/Dodie324/la_breakable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Dodie324/la_breakable/merges","archive_url":"https://api.github.com/repos/Dodie324/la_breakable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Dodie324/la_breakable/downloads","issues_url":"https://api.github.com/repos/Dodie324/la_breakable/issues{/number}","pulls_url":"https://api.github.com/repos/Dodie324/la_breakable/pulls{/number}","milestones_url":"https://api.github.com/repos/Dodie324/la_breakable/milestones{/number}","notifications_url":"https://api.github.com/repos/Dodie324/la_breakable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Dodie324/la_breakable/labels{/name}","releases_url":"https://api.github.com/repos/Dodie324/la_breakable/releases{/id}","created_at":"2015-03-29T18:46:55Z","updated_at":"2015-03-30T02:53:12Z","pushed_at":"2015-04-13T18:56:57Z","git_url":"git://github.com/Dodie324/la_breakable.git","ssh_url":"git@github.com:Dodie324/la_breakable.git","clone_url":"https://github.com/Dodie324/la_breakable.git","svn_url":"https://github.com/Dodie324/la_breakable","homepage":null,"size":448,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Dodie324:master","ref":"master","sha":"3e85edec225448111023858834c3b4b706522a23","user":{"login":"Dodie324","id":9405172,"avatar_url":"https://avatars.githubusercontent.com/u/9405172?v=3","gravatar_id":"","url":"https://api.github.com/users/Dodie324","html_url":"https://github.com/Dodie324","followers_url":"https://api.github.com/users/Dodie324/followers","following_url":"https://api.github.com/users/Dodie324/following{/other_user}","gists_url":"https://api.github.com/users/Dodie324/gists{/gist_id}","starred_url":"https://api.github.com/users/Dodie324/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dodie324/subscriptions","organizations_url":"https://api.github.com/users/Dodie324/orgs","repos_url":"https://api.github.com/users/Dodie324/repos","events_url":"https://api.github.com/users/Dodie324/events{/privacy}","received_events_url":"https://api.github.com/users/Dodie324/received_events","type":"User","site_admin":false},"repo":{"id":33084478,"name":"la_breakable","full_name":"Dodie324/la_breakable","owner":{"login":"Dodie324","id":9405172,"avatar_url":"https://avatars.githubusercontent.com/u/9405172?v=3","gravatar_id":"","url":"https://api.github.com/users/Dodie324","html_url":"https://github.com/Dodie324","followers_url":"https://api.github.com/users/Dodie324/followers","following_url":"https://api.github.com/users/Dodie324/following{/other_user}","gists_url":"https://api.github.com/users/Dodie324/gists{/gist_id}","starred_url":"https://api.github.com/users/Dodie324/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dodie324/subscriptions","organizations_url":"https://api.github.com/users/Dodie324/orgs","repos_url":"https://api.github.com/users/Dodie324/repos","events_url":"https://api.github.com/users/Dodie324/events{/privacy}","received_events_url":"https://api.github.com/users/Dodie324/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Dodie324/la_breakable","description":"","fork":false,"url":"https://api.github.com/repos/Dodie324/la_breakable","forks_url":"https://api.github.com/repos/Dodie324/la_breakable/forks","keys_url":"https://api.github.com/repos/Dodie324/la_breakable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Dodie324/la_breakable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Dodie324/la_breakable/teams","hooks_url":"https://api.github.com/repos/Dodie324/la_breakable/hooks","issue_events_url":"https://api.github.com/repos/Dodie324/la_breakable/issues/events{/number}","events_url":"https://api.github.com/repos/Dodie324/la_breakable/events","assignees_url":"https://api.github.com/repos/Dodie324/la_breakable/assignees{/user}","branches_url":"https://api.github.com/repos/Dodie324/la_breakable/branches{/branch}","tags_url":"https://api.github.com/repos/Dodie324/la_breakable/tags","blobs_url":"https://api.github.com/repos/Dodie324/la_breakable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Dodie324/la_breakable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Dodie324/la_breakable/git/refs{/sha}","trees_url":"https://api.github.com/repos/Dodie324/la_breakable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Dodie324/la_breakable/statuses/{sha}","languages_url":"https://api.github.com/repos/Dodie324/la_breakable/languages","stargazers_url":"https://api.github.com/repos/Dodie324/la_breakable/stargazers","contributors_url":"https://api.github.com/repos/Dodie324/la_breakable/contributors","subscribers_url":"https://api.github.com/repos/Dodie324/la_breakable/subscribers","subscription_url":"https://api.github.com/repos/Dodie324/la_breakable/subscription","commits_url":"https://api.github.com/repos/Dodie324/la_breakable/commits{/sha}","git_commits_url":"https://api.github.com/repos/Dodie324/la_breakable/git/commits{/sha}","comments_url":"https://api.github.com/repos/Dodie324/la_breakable/comments{/number}","issue_comment_url":"https://api.github.com/repos/Dodie324/la_breakable/issues/comments{/number}","contents_url":"https://api.github.com/repos/Dodie324/la_breakable/contents/{+path}","compare_url":"https://api.github.com/repos/Dodie324/la_breakable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Dodie324/la_breakable/merges","archive_url":"https://api.github.com/repos/Dodie324/la_breakable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Dodie324/la_breakable/downloads","issues_url":"https://api.github.com/repos/Dodie324/la_breakable/issues{/number}","pulls_url":"https://api.github.com/repos/Dodie324/la_breakable/pulls{/number}","milestones_url":"https://api.github.com/repos/Dodie324/la_breakable/milestones{/number}","notifications_url":"https://api.github.com/repos/Dodie324/la_breakable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Dodie324/la_breakable/labels{/name}","releases_url":"https://api.github.com/repos/Dodie324/la_breakable/releases{/id}","created_at":"2015-03-29T18:46:55Z","updated_at":"2015-03-30T02:53:12Z","pushed_at":"2015-04-13T18:56:57Z","git_url":"git://github.com/Dodie324/la_breakable.git","ssh_url":"git@github.com:Dodie324/la_breakable.git","clone_url":"https://github.com/Dodie324/la_breakable.git","svn_url":"https://github.com/Dodie324/la_breakable","homepage":null,"size":448,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Dodie324/la_breakable/pulls/1"},"html":{"href":"https://github.com/Dodie324/la_breakable/pull/1"},"issue":{"href":"https://api.github.com/repos/Dodie324/la_breakable/issues/1"},"comments":{"href":"https://api.github.com/repos/Dodie324/la_breakable/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Dodie324/la_breakable/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Dodie324/la_breakable/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Dodie324/la_breakable/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Dodie324/la_breakable/statuses/ad5fdce8a56131665e29dd544b6a58cf76bc47b6"}}}}