{"action":"created","comment":{"url":"https://api.github.com/repos/cluhring/the_pivot/pulls/comments/25385949","id":25385949,"diff_hunk":"@@ -1,13 +1,36 @@\n class CartsController < ApplicationController\n   def create\n-    @cart.add_item(params[:item_id])\n-    session[:cart] = @cart.data\n-    redirect_to categories_path\n+    if current_user\n+      @cart.add_listing(params, current_user.id)\n+      session[\"cart\"] = @cart.data\n+      flash[:notice] = \"Listing Successfully Added To Reservations\"\n+      redirect_to :back\n+    else\n+      flash[:notice] = \"Please log in to book this listing\"\n+      redirect_to :back\n+    end\n   end\n \n   def destroy\n     @cart.remove_item(params[:item_id])\n-    session[:cart] = @cart.data\n+    session[\"cart\"] = @cart.data\n     redirect_to new_reservation_path\n   end\n+\n+  private\n+  #\n+  # def update_cart\n+  #   listing = Listing.find(params[:listing_id])\n+  #   @cart.add_listing(listing)\n+  #   session[:cart] = @cart.data\n+  # end\n+\n+","path":"app/controllers/carts_controller.rb","position":32,"original_position":32,"commit_id":"4551d04072a3d59a913df6a096b3bfae2eb7d16d","original_commit_id":"4551d04072a3d59a913df6a096b3bfae2eb7d16d","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Extra blank line detected.","created_at":"2015-02-25T22:25:31Z","updated_at":"2015-02-25T22:25:31Z","html_url":"https://github.com/cluhring/the_pivot/pull/120#discussion_r25385949","pull_request_url":"https://api.github.com/repos/cluhring/the_pivot/pulls/120","_links":{"self":{"href":"https://api.github.com/repos/cluhring/the_pivot/pulls/comments/25385949"},"html":{"href":"https://github.com/cluhring/the_pivot/pull/120#discussion_r25385949"},"pull_request":{"href":"https://api.github.com/repos/cluhring/the_pivot/pulls/120"}}},"pull_request":{"url":"https://api.github.com/repos/cluhring/the_pivot/pulls/120","id":30031724,"html_url":"https://github.com/cluhring/the_pivot/pull/120","diff_url":"https://github.com/cluhring/the_pivot/pull/120.diff","patch_url":"https://github.com/cluhring/the_pivot/pull/120.patch","issue_url":"https://api.github.com/repos/cluhring/the_pivot/issues/120","number":120,"state":"open","locked":false,"title":"Begin cart","user":{"login":"Lydias303","id":8863407,"avatar_url":"https://avatars.githubusercontent.com/u/8863407?v=3","gravatar_id":"","url":"https://api.github.com/users/Lydias303","html_url":"https://github.com/Lydias303","followers_url":"https://api.github.com/users/Lydias303/followers","following_url":"https://api.github.com/users/Lydias303/following{/other_user}","gists_url":"https://api.github.com/users/Lydias303/gists{/gist_id}","starred_url":"https://api.github.com/users/Lydias303/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lydias303/subscriptions","organizations_url":"https://api.github.com/users/Lydias303/orgs","repos_url":"https://api.github.com/users/Lydias303/repos","events_url":"https://api.github.com/users/Lydias303/events{/privacy}","received_events_url":"https://api.github.com/users/Lydias303/received_events","type":"User","site_admin":false},"body":"Finished the cart all is well and working! Tests passing! Latest master pulled in should be conflict free! :sparkles: ","created_at":"2015-02-25T22:25:27Z","updated_at":"2015-02-25T22:25:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66ccf2037a6fec28052c9862e08258da6fe52d1a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cluhring/the_pivot/pulls/120/commits","review_comments_url":"https://api.github.com/repos/cluhring/the_pivot/pulls/120/comments","review_comment_url":"https://api.github.com/repos/cluhring/the_pivot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cluhring/the_pivot/issues/120/comments","statuses_url":"https://api.github.com/repos/cluhring/the_pivot/statuses/4551d04072a3d59a913df6a096b3bfae2eb7d16d","head":{"label":"cluhring:begin-cart","ref":"begin-cart","sha":"4551d04072a3d59a913df6a096b3bfae2eb7d16d","user":{"login":"cluhring","id":8466906,"avatar_url":"https://avatars.githubusercontent.com/u/8466906?v=3","gravatar_id":"","url":"https://api.github.com/users/cluhring","html_url":"https://github.com/cluhring","followers_url":"https://api.github.com/users/cluhring/followers","following_url":"https://api.github.com/users/cluhring/following{/other_user}","gists_url":"https://api.github.com/users/cluhring/gists{/gist_id}","starred_url":"https://api.github.com/users/cluhring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cluhring/subscriptions","organizations_url":"https://api.github.com/users/cluhring/orgs","repos_url":"https://api.github.com/users/cluhring/repos","events_url":"https://api.github.com/users/cluhring/events{/privacy}","received_events_url":"https://api.github.com/users/cluhring/received_events","type":"User","site_admin":false},"repo":{"id":30557499,"name":"the_pivot","full_name":"cluhring/the_pivot","owner":{"login":"cluhring","id":8466906,"avatar_url":"https://avatars.githubusercontent.com/u/8466906?v=3","gravatar_id":"","url":"https://api.github.com/users/cluhring","html_url":"https://github.com/cluhring","followers_url":"https://api.github.com/users/cluhring/followers","following_url":"https://api.github.com/users/cluhring/following{/other_user}","gists_url":"https://api.github.com/users/cluhring/gists{/gist_id}","starred_url":"https://api.github.com/users/cluhring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cluhring/subscriptions","organizations_url":"https://api.github.com/users/cluhring/orgs","repos_url":"https://api.github.com/users/cluhring/repos","events_url":"https://api.github.com/users/cluhring/events{/privacy}","received_events_url":"https://api.github.com/users/cluhring/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cluhring/the_pivot","description":"Lydia, Bryce, Kit and Chris Pivot Dinner Dash into Travel Home","fork":false,"url":"https://api.github.com/repos/cluhring/the_pivot","forks_url":"https://api.github.com/repos/cluhring/the_pivot/forks","keys_url":"https://api.github.com/repos/cluhring/the_pivot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cluhring/the_pivot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cluhring/the_pivot/teams","hooks_url":"https://api.github.com/repos/cluhring/the_pivot/hooks","issue_events_url":"https://api.github.com/repos/cluhring/the_pivot/issues/events{/number}","events_url":"https://api.github.com/repos/cluhring/the_pivot/events","assignees_url":"https://api.github.com/repos/cluhring/the_pivot/assignees{/user}","branches_url":"https://api.github.com/repos/cluhring/the_pivot/branches{/branch}","tags_url":"https://api.github.com/repos/cluhring/the_pivot/tags","blobs_url":"https://api.github.com/repos/cluhring/the_pivot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cluhring/the_pivot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cluhring/the_pivot/git/refs{/sha}","trees_url":"https://api.github.com/repos/cluhring/the_pivot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cluhring/the_pivot/statuses/{sha}","languages_url":"https://api.github.com/repos/cluhring/the_pivot/languages","stargazers_url":"https://api.github.com/repos/cluhring/the_pivot/stargazers","contributors_url":"https://api.github.com/repos/cluhring/the_pivot/contributors","subscribers_url":"https://api.github.com/repos/cluhring/the_pivot/subscribers","subscription_url":"https://api.github.com/repos/cluhring/the_pivot/subscription","commits_url":"https://api.github.com/repos/cluhring/the_pivot/commits{/sha}","git_commits_url":"https://api.github.com/repos/cluhring/the_pivot/git/commits{/sha}","comments_url":"https://api.github.com/repos/cluhring/the_pivot/comments{/number}","issue_comment_url":"https://api.github.com/repos/cluhring/the_pivot/issues/comments{/number}","contents_url":"https://api.github.com/repos/cluhring/the_pivot/contents/{+path}","compare_url":"https://api.github.com/repos/cluhring/the_pivot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cluhring/the_pivot/merges","archive_url":"https://api.github.com/repos/cluhring/the_pivot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cluhring/the_pivot/downloads","issues_url":"https://api.github.com/repos/cluhring/the_pivot/issues{/number}","pulls_url":"https://api.github.com/repos/cluhring/the_pivot/pulls{/number}","milestones_url":"https://api.github.com/repos/cluhring/the_pivot/milestones{/number}","notifications_url":"https://api.github.com/repos/cluhring/the_pivot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cluhring/the_pivot/labels{/name}","releases_url":"https://api.github.com/repos/cluhring/the_pivot/releases{/id}","created_at":"2015-02-09T20:43:51Z","updated_at":"2015-02-25T21:29:45Z","pushed_at":"2015-02-25T22:24:20Z","git_url":"git://github.com/cluhring/the_pivot.git","ssh_url":"git@github.com:cluhring/the_pivot.git","clone_url":"https://github.com/cluhring/the_pivot.git","svn_url":"https://github.com/cluhring/the_pivot","homepage":null,"size":48203,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":41,"forks":2,"open_issues":41,"watchers":0,"default_branch":"master"}},"base":{"label":"cluhring:master","ref":"master","sha":"269d7ab64c78e4a40c02472ab5fc523db47588aa","user":{"login":"cluhring","id":8466906,"avatar_url":"https://avatars.githubusercontent.com/u/8466906?v=3","gravatar_id":"","url":"https://api.github.com/users/cluhring","html_url":"https://github.com/cluhring","followers_url":"https://api.github.com/users/cluhring/followers","following_url":"https://api.github.com/users/cluhring/following{/other_user}","gists_url":"https://api.github.com/users/cluhring/gists{/gist_id}","starred_url":"https://api.github.com/users/cluhring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cluhring/subscriptions","organizations_url":"https://api.github.com/users/cluhring/orgs","repos_url":"https://api.github.com/users/cluhring/repos","events_url":"https://api.github.com/users/cluhring/events{/privacy}","received_events_url":"https://api.github.com/users/cluhring/received_events","type":"User","site_admin":false},"repo":{"id":30557499,"name":"the_pivot","full_name":"cluhring/the_pivot","owner":{"login":"cluhring","id":8466906,"avatar_url":"https://avatars.githubusercontent.com/u/8466906?v=3","gravatar_id":"","url":"https://api.github.com/users/cluhring","html_url":"https://github.com/cluhring","followers_url":"https://api.github.com/users/cluhring/followers","following_url":"https://api.github.com/users/cluhring/following{/other_user}","gists_url":"https://api.github.com/users/cluhring/gists{/gist_id}","starred_url":"https://api.github.com/users/cluhring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cluhring/subscriptions","organizations_url":"https://api.github.com/users/cluhring/orgs","repos_url":"https://api.github.com/users/cluhring/repos","events_url":"https://api.github.com/users/cluhring/events{/privacy}","received_events_url":"https://api.github.com/users/cluhring/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cluhring/the_pivot","description":"Lydia, Bryce, Kit and Chris Pivot Dinner Dash into Travel Home","fork":false,"url":"https://api.github.com/repos/cluhring/the_pivot","forks_url":"https://api.github.com/repos/cluhring/the_pivot/forks","keys_url":"https://api.github.com/repos/cluhring/the_pivot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cluhring/the_pivot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cluhring/the_pivot/teams","hooks_url":"https://api.github.com/repos/cluhring/the_pivot/hooks","issue_events_url":"https://api.github.com/repos/cluhring/the_pivot/issues/events{/number}","events_url":"https://api.github.com/repos/cluhring/the_pivot/events","assignees_url":"https://api.github.com/repos/cluhring/the_pivot/assignees{/user}","branches_url":"https://api.github.com/repos/cluhring/the_pivot/branches{/branch}","tags_url":"https://api.github.com/repos/cluhring/the_pivot/tags","blobs_url":"https://api.github.com/repos/cluhring/the_pivot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cluhring/the_pivot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cluhring/the_pivot/git/refs{/sha}","trees_url":"https://api.github.com/repos/cluhring/the_pivot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cluhring/the_pivot/statuses/{sha}","languages_url":"https://api.github.com/repos/cluhring/the_pivot/languages","stargazers_url":"https://api.github.com/repos/cluhring/the_pivot/stargazers","contributors_url":"https://api.github.com/repos/cluhring/the_pivot/contributors","subscribers_url":"https://api.github.com/repos/cluhring/the_pivot/subscribers","subscription_url":"https://api.github.com/repos/cluhring/the_pivot/subscription","commits_url":"https://api.github.com/repos/cluhring/the_pivot/commits{/sha}","git_commits_url":"https://api.github.com/repos/cluhring/the_pivot/git/commits{/sha}","comments_url":"https://api.github.com/repos/cluhring/the_pivot/comments{/number}","issue_comment_url":"https://api.github.com/repos/cluhring/the_pivot/issues/comments{/number}","contents_url":"https://api.github.com/repos/cluhring/the_pivot/contents/{+path}","compare_url":"https://api.github.com/repos/cluhring/the_pivot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cluhring/the_pivot/merges","archive_url":"https://api.github.com/repos/cluhring/the_pivot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cluhring/the_pivot/downloads","issues_url":"https://api.github.com/repos/cluhring/the_pivot/issues{/number}","pulls_url":"https://api.github.com/repos/cluhring/the_pivot/pulls{/number}","milestones_url":"https://api.github.com/repos/cluhring/the_pivot/milestones{/number}","notifications_url":"https://api.github.com/repos/cluhring/the_pivot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cluhring/the_pivot/labels{/name}","releases_url":"https://api.github.com/repos/cluhring/the_pivot/releases{/id}","created_at":"2015-02-09T20:43:51Z","updated_at":"2015-02-25T21:29:45Z","pushed_at":"2015-02-25T22:24:20Z","git_url":"git://github.com/cluhring/the_pivot.git","ssh_url":"git@github.com:cluhring/the_pivot.git","clone_url":"https://github.com/cluhring/the_pivot.git","svn_url":"https://github.com/cluhring/the_pivot","homepage":null,"size":48203,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":41,"forks":2,"open_issues":41,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cluhring/the_pivot/pulls/120"},"html":{"href":"https://github.com/cluhring/the_pivot/pull/120"},"issue":{"href":"https://api.github.com/repos/cluhring/the_pivot/issues/120"},"comments":{"href":"https://api.github.com/repos/cluhring/the_pivot/issues/120/comments"},"review_comments":{"href":"https://api.github.com/repos/cluhring/the_pivot/pulls/120/comments"},"review_comment":{"href":"https://api.github.com/repos/cluhring/the_pivot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cluhring/the_pivot/pulls/120/commits"},"statuses":{"href":"https://api.github.com/repos/cluhring/the_pivot/statuses/4551d04072a3d59a913df6a096b3bfae2eb7d16d"}}}}