{"action":"created","comment":{"url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/pulls/comments/58895633","id":58895633,"diff_hunk":"@@ -0,0 +1,61 @@\n+require \"pry\"\n+require \"mailgun\"\n+\n+class ReviewsController < ApplicationController\n+  def index\n+    @reviews = Review.all\n+  end\n+\n+  def edit\n+    @bar = Bar.find(params[:bar_id])\n+    @review = Review.find(params[:id])\n+    @reviews = @bar.reviews.order(created_at: :asc)\n+  end\n+\n+  def update\n+    @review = Review.find(params[:id])\n+    @bar = Bar.find(params[:bar_id])\n+    if @review.update_attributes(review_params)\n+      flash[:notice] = \"Review updated.\"\n+      redirect_to bar_path(@bar)\n+    else\n+      flash[:notice] = @review.errors.full_messages.join(\". \")\n+      render :edit\n+    end\n+  end\n+\n+  def create\n+    current_user\n+    @bar = Bar.find(params[:bar_id])\n+    @review = Review.new(review_params)\n+    @review.bar = @bar\n+    @review.user = @current_user\n+    @reviews = @bar.reviews.order(created_at: :asc)\n+\n+    if @review.save\n+      flash[:notice] = \"Review added\"\n+      redirect_to bar_path(@bar)\n+    else\n+      flash[:alert] = @review.errors.full_messages.join(\". \")\n+      render \"bars/show\"\n+    end\n+  end\n+\n+  def destroy\n+    current_user\n+    @bar = Bar.find(params[:bar_id])\n+    @review = Review.find(params[:id])\n+    if @review.destroy\n+      flash[:alert] = \"Review has been deleted\"\n+      redirect_to bar_path(@bar)\n+    else\n+      flash[:alert] = \"Error: Review has not been deleted\"\n+      redirect_to bar_path(@bar)\n+    end\n+  end\n+\n+","path":"app/controllers/reviews_controller.rb","position":57,"original_position":57,"commit_id":"70604036940eabe513ee2e45f033023300bbfba0","original_commit_id":"70604036940eabe513ee2e45f033023300bbfba0","user":{"login":"alxjrvs","id":174825,"avatar_url":"https://avatars.githubusercontent.com/u/174825?v=3","gravatar_id":"","url":"https://api.github.com/users/alxjrvs","html_url":"https://github.com/alxjrvs","followers_url":"https://api.github.com/users/alxjrvs/followers","following_url":"https://api.github.com/users/alxjrvs/following{/other_user}","gists_url":"https://api.github.com/users/alxjrvs/gists{/gist_id}","starred_url":"https://api.github.com/users/alxjrvs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alxjrvs/subscriptions","organizations_url":"https://api.github.com/users/alxjrvs/orgs","repos_url":"https://api.github.com/users/alxjrvs/repos","events_url":"https://api.github.com/users/alxjrvs/events{/privacy}","received_events_url":"https://api.github.com/users/alxjrvs/received_events","type":"User","site_admin":false},"body":"remove extraneous blank line","created_at":"2016-04-07T15:49:22Z","updated_at":"2016-04-07T15:49:22Z","html_url":"https://github.com/ncrawford0/the-usual-suspects/pull/9#discussion_r58895633","pull_request_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/ncrawford0/the-usual-suspects/pulls/comments/58895633"},"html":{"href":"https://github.com/ncrawford0/the-usual-suspects/pull/9#discussion_r58895633"},"pull_request":{"href":"https://api.github.com/repos/ncrawford0/the-usual-suspects/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/pulls/9","id":65628340,"html_url":"https://github.com/ncrawford0/the-usual-suspects/pull/9","diff_url":"https://github.com/ncrawford0/the-usual-suspects/pull/9.diff","patch_url":"https://github.com/ncrawford0/the-usual-suspects/pull/9.patch","issue_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/issues/9","number":9,"state":"open","locked":false,"title":"Link reviews","user":{"login":"ncrawford0","id":17457084,"avatar_url":"https://avatars.githubusercontent.com/u/17457084?v=3","gravatar_id":"","url":"https://api.github.com/users/ncrawford0","html_url":"https://github.com/ncrawford0","followers_url":"https://api.github.com/users/ncrawford0/followers","following_url":"https://api.github.com/users/ncrawford0/following{/other_user}","gists_url":"https://api.github.com/users/ncrawford0/gists{/gist_id}","starred_url":"https://api.github.com/users/ncrawford0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncrawford0/subscriptions","organizations_url":"https://api.github.com/users/ncrawford0/orgs","repos_url":"https://api.github.com/users/ncrawford0/repos","events_url":"https://api.github.com/users/ncrawford0/events{/privacy}","received_events_url":"https://api.github.com/users/ncrawford0/received_events","type":"User","site_admin":false},"body":"This contains all the core functionality with fixes for the problems with the integration commit.  ","created_at":"2016-04-07T13:19:13Z","updated_at":"2016-04-07T15:49:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7fe1fd31c4ec70b64c6238bee60872213ab6aff6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/pulls/9/commits","review_comments_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/pulls/9/comments","review_comment_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/issues/9/comments","statuses_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/statuses/70604036940eabe513ee2e45f033023300bbfba0","head":{"label":"ncrawford0:link_reviews","ref":"link_reviews","sha":"70604036940eabe513ee2e45f033023300bbfba0","user":{"login":"ncrawford0","id":17457084,"avatar_url":"https://avatars.githubusercontent.com/u/17457084?v=3","gravatar_id":"","url":"https://api.github.com/users/ncrawford0","html_url":"https://github.com/ncrawford0","followers_url":"https://api.github.com/users/ncrawford0/followers","following_url":"https://api.github.com/users/ncrawford0/following{/other_user}","gists_url":"https://api.github.com/users/ncrawford0/gists{/gist_id}","starred_url":"https://api.github.com/users/ncrawford0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncrawford0/subscriptions","organizations_url":"https://api.github.com/users/ncrawford0/orgs","repos_url":"https://api.github.com/users/ncrawford0/repos","events_url":"https://api.github.com/users/ncrawford0/events{/privacy}","received_events_url":"https://api.github.com/users/ncrawford0/received_events","type":"User","site_admin":false},"repo":{"id":55421713,"name":"the-usual-suspects","full_name":"ncrawford0/the-usual-suspects","owner":{"login":"ncrawford0","id":17457084,"avatar_url":"https://avatars.githubusercontent.com/u/17457084?v=3","gravatar_id":"","url":"https://api.github.com/users/ncrawford0","html_url":"https://github.com/ncrawford0","followers_url":"https://api.github.com/users/ncrawford0/followers","following_url":"https://api.github.com/users/ncrawford0/following{/other_user}","gists_url":"https://api.github.com/users/ncrawford0/gists{/gist_id}","starred_url":"https://api.github.com/users/ncrawford0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncrawford0/subscriptions","organizations_url":"https://api.github.com/users/ncrawford0/orgs","repos_url":"https://api.github.com/users/ncrawford0/repos","events_url":"https://api.github.com/users/ncrawford0/events{/privacy}","received_events_url":"https://api.github.com/users/ncrawford0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ncrawford0/the-usual-suspects","description":"Review site group project.","fork":false,"url":"https://api.github.com/repos/ncrawford0/the-usual-suspects","forks_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/forks","keys_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/teams","hooks_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/hooks","issue_events_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/issues/events{/number}","events_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/events","assignees_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/assignees{/user}","branches_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/branches{/branch}","tags_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/tags","blobs_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/git/refs{/sha}","trees_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/statuses/{sha}","languages_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/languages","stargazers_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/stargazers","contributors_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/contributors","subscribers_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/subscribers","subscription_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/subscription","commits_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/commits{/sha}","git_commits_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/git/commits{/sha}","comments_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/comments{/number}","issue_comment_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/issues/comments{/number}","contents_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/contents/{+path}","compare_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/merges","archive_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/downloads","issues_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/issues{/number}","pulls_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/pulls{/number}","milestones_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/milestones{/number}","notifications_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/labels{/name}","releases_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/releases{/id}","deployments_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/deployments","created_at":"2016-04-04T15:16:45Z","updated_at":"2016-04-06T20:43:49Z","pushed_at":"2016-04-07T15:44:42Z","git_url":"git://github.com/ncrawford0/the-usual-suspects.git","ssh_url":"git@github.com:ncrawford0/the-usual-suspects.git","clone_url":"https://github.com/ncrawford0/the-usual-suspects.git","svn_url":"https://github.com/ncrawford0/the-usual-suspects","homepage":null,"size":371,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"ncrawford0:master","ref":"master","sha":"21b5b070a8ed9f0cde45575114d068f7179040d1","user":{"login":"ncrawford0","id":17457084,"avatar_url":"https://avatars.githubusercontent.com/u/17457084?v=3","gravatar_id":"","url":"https://api.github.com/users/ncrawford0","html_url":"https://github.com/ncrawford0","followers_url":"https://api.github.com/users/ncrawford0/followers","following_url":"https://api.github.com/users/ncrawford0/following{/other_user}","gists_url":"https://api.github.com/users/ncrawford0/gists{/gist_id}","starred_url":"https://api.github.com/users/ncrawford0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncrawford0/subscriptions","organizations_url":"https://api.github.com/users/ncrawford0/orgs","repos_url":"https://api.github.com/users/ncrawford0/repos","events_url":"https://api.github.com/users/ncrawford0/events{/privacy}","received_events_url":"https://api.github.com/users/ncrawford0/received_events","type":"User","site_admin":false},"repo":{"id":55421713,"name":"the-usual-suspects","full_name":"ncrawford0/the-usual-suspects","owner":{"login":"ncrawford0","id":17457084,"avatar_url":"https://avatars.githubusercontent.com/u/17457084?v=3","gravatar_id":"","url":"https://api.github.com/users/ncrawford0","html_url":"https://github.com/ncrawford0","followers_url":"https://api.github.com/users/ncrawford0/followers","following_url":"https://api.github.com/users/ncrawford0/following{/other_user}","gists_url":"https://api.github.com/users/ncrawford0/gists{/gist_id}","starred_url":"https://api.github.com/users/ncrawford0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncrawford0/subscriptions","organizations_url":"https://api.github.com/users/ncrawford0/orgs","repos_url":"https://api.github.com/users/ncrawford0/repos","events_url":"https://api.github.com/users/ncrawford0/events{/privacy}","received_events_url":"https://api.github.com/users/ncrawford0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ncrawford0/the-usual-suspects","description":"Review site group project.","fork":false,"url":"https://api.github.com/repos/ncrawford0/the-usual-suspects","forks_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/forks","keys_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/teams","hooks_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/hooks","issue_events_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/issues/events{/number}","events_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/events","assignees_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/assignees{/user}","branches_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/branches{/branch}","tags_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/tags","blobs_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/git/refs{/sha}","trees_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/statuses/{sha}","languages_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/languages","stargazers_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/stargazers","contributors_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/contributors","subscribers_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/subscribers","subscription_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/subscription","commits_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/commits{/sha}","git_commits_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/git/commits{/sha}","comments_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/comments{/number}","issue_comment_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/issues/comments{/number}","contents_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/contents/{+path}","compare_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/merges","archive_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/downloads","issues_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/issues{/number}","pulls_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/pulls{/number}","milestones_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/milestones{/number}","notifications_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/labels{/name}","releases_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/releases{/id}","deployments_url":"https://api.github.com/repos/ncrawford0/the-usual-suspects/deployments","created_at":"2016-04-04T15:16:45Z","updated_at":"2016-04-06T20:43:49Z","pushed_at":"2016-04-07T15:44:42Z","git_url":"git://github.com/ncrawford0/the-usual-suspects.git","ssh_url":"git@github.com:ncrawford0/the-usual-suspects.git","clone_url":"https://github.com/ncrawford0/the-usual-suspects.git","svn_url":"https://github.com/ncrawford0/the-usual-suspects","homepage":null,"size":371,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ncrawford0/the-usual-suspects/pulls/9"},"html":{"href":"https://github.com/ncrawford0/the-usual-suspects/pull/9"},"issue":{"href":"https://api.github.com/repos/ncrawford0/the-usual-suspects/issues/9"},"comments":{"href":"https://api.github.com/repos/ncrawford0/the-usual-suspects/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/ncrawford0/the-usual-suspects/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/ncrawford0/the-usual-suspects/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ncrawford0/the-usual-suspects/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/ncrawford0/the-usual-suspects/statuses/70604036940eabe513ee2e45f033023300bbfba0"}}}}