{"action":"created","comment":{"url":"https://api.github.com/repos/sophiabaldonado/betsy/pulls/comments/66283915","id":66283915,"diff_hunk":"@@ -74,23 +114,27 @@ def create\n       @user_id = session[:user_id] if session[:user_id]\n       @billing_id = @billing.id\n       @order_number = order_number\n-      @order = Order.new(status: \"pending\", total: total_order_revenue(@cart_items), confirmation_date: Time.now, order_number: @order_number, billing_id: @billing_id, user_id: @user_id)\n+      @order = Order.new(status: \"pending\", total: total_order_revenue(@cart_items), confirmation_date: Time.now, order_number: @order_number, billing_id: @billing_id, user_id: @user_id, carrier_type: @carrier_type, carrier_price: @carrier_price)\n       if @order.save\n         @cart_items.each do |item|\n           @order_item = OrderItem.new(quantity: item.quantity, name: item.product.name, price: item.product.price*item.quantity, status: \"pending\", order_id: @order.id, product_id: item.product.id)\n           @order_item.save\n           item.destroy\n           @order_item.product.update(inventory: @order_item.product.inventory - @order_item.quantity)\n         end\n+\n+\n         if current_user\n           redirect_to user_order_path(current_user.id, @order.id)\n         else\n           redirect_to checkout_confirmation_path(@order.id)\n         end\n       else\n+\n         render \"/billings/new\"\n       end\n     else\n+\n         render \"/billings/new\"\n     end","path":"app/controllers/orders_controller.rb","position":112,"original_position":112,"commit_id":"2b37784079c648f094e3e9dea7a0ff48a2f9a5c2","original_commit_id":"2b37784079c648f094e3e9dea7a0ff48a2f9a5c2","user":{"login":"TamarHershi","id":13411755,"avatar_url":"https://avatars.githubusercontent.com/u/13411755?v=3","gravatar_id":"","url":"https://api.github.com/users/TamarHershi","html_url":"https://github.com/TamarHershi","followers_url":"https://api.github.com/users/TamarHershi/followers","following_url":"https://api.github.com/users/TamarHershi/following{/other_user}","gists_url":"https://api.github.com/users/TamarHershi/gists{/gist_id}","starred_url":"https://api.github.com/users/TamarHershi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TamarHershi/subscriptions","organizations_url":"https://api.github.com/users/TamarHershi/orgs","repos_url":"https://api.github.com/users/TamarHershi/repos","events_url":"https://api.github.com/users/TamarHershi/events{/privacy}","received_events_url":"https://api.github.com/users/TamarHershi/received_events","type":"User","site_admin":false},"body":"Since the end result if the use / billing haven't been saved is the same - you could render the \"/billings/new\" only once just before the last end ","created_at":"2016-06-08T15:56:03Z","updated_at":"2016-06-08T15:56:03Z","html_url":"https://github.com/sophiabaldonado/betsy/pull/1#discussion_r66283915","pull_request_url":"https://api.github.com/repos/sophiabaldonado/betsy/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/sophiabaldonado/betsy/pulls/comments/66283915"},"html":{"href":"https://github.com/sophiabaldonado/betsy/pull/1#discussion_r66283915"},"pull_request":{"href":"https://api.github.com/repos/sophiabaldonado/betsy/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/sophiabaldonado/betsy/pulls/1","id":71128779,"html_url":"https://github.com/sophiabaldonado/betsy/pull/1","diff_url":"https://github.com/sophiabaldonado/betsy/pull/1.diff","patch_url":"https://github.com/sophiabaldonado/betsy/pull/1.patch","issue_url":"https://api.github.com/repos/sophiabaldonado/betsy/issues/1","number":1,"state":"open","locked":false,"title":"Added precursor to shipping API call","user":{"login":"nicosaki","id":10930700,"avatar_url":"https://avatars.githubusercontent.com/u/10930700?v=3","gravatar_id":"","url":"https://api.github.com/users/nicosaki","html_url":"https://github.com/nicosaki","followers_url":"https://api.github.com/users/nicosaki/followers","following_url":"https://api.github.com/users/nicosaki/following{/other_user}","gists_url":"https://api.github.com/users/nicosaki/gists{/gist_id}","starred_url":"https://api.github.com/users/nicosaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicosaki/subscriptions","organizations_url":"https://api.github.com/users/nicosaki/orgs","repos_url":"https://api.github.com/users/nicosaki/repos","events_url":"https://api.github.com/users/nicosaki/events{/privacy}","received_events_url":"https://api.github.com/users/nicosaki/received_events","type":"User","site_admin":false},"body":"We touched your stuff.\r\nAdded a few pages in the checkout process to collect shipping address and offer shipping options for selection. Added a column to order model I think, I don't even know. Also contributed to your spaghetti bucket ^_^","created_at":"2016-05-23T22:08:50Z","updated_at":"2016-06-08T15:56:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0220a240ae8f2785e04835216c07b253b44077ff","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sophiabaldonado/betsy/pulls/1/commits","review_comments_url":"https://api.github.com/repos/sophiabaldonado/betsy/pulls/1/comments","review_comment_url":"https://api.github.com/repos/sophiabaldonado/betsy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sophiabaldonado/betsy/issues/1/comments","statuses_url":"https://api.github.com/repos/sophiabaldonado/betsy/statuses/2b37784079c648f094e3e9dea7a0ff48a2f9a5c2","head":{"label":"nicosaki:master","ref":"master","sha":"2b37784079c648f094e3e9dea7a0ff48a2f9a5c2","user":{"login":"nicosaki","id":10930700,"avatar_url":"https://avatars.githubusercontent.com/u/10930700?v=3","gravatar_id":"","url":"https://api.github.com/users/nicosaki","html_url":"https://github.com/nicosaki","followers_url":"https://api.github.com/users/nicosaki/followers","following_url":"https://api.github.com/users/nicosaki/following{/other_user}","gists_url":"https://api.github.com/users/nicosaki/gists{/gist_id}","starred_url":"https://api.github.com/users/nicosaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicosaki/subscriptions","organizations_url":"https://api.github.com/users/nicosaki/orgs","repos_url":"https://api.github.com/users/nicosaki/repos","events_url":"https://api.github.com/users/nicosaki/events{/privacy}","received_events_url":"https://api.github.com/users/nicosaki/received_events","type":"User","site_admin":false},"repo":{"id":59519239,"name":"betsy","full_name":"nicosaki/betsy","owner":{"login":"nicosaki","id":10930700,"avatar_url":"https://avatars.githubusercontent.com/u/10930700?v=3","gravatar_id":"","url":"https://api.github.com/users/nicosaki","html_url":"https://github.com/nicosaki","followers_url":"https://api.github.com/users/nicosaki/followers","following_url":"https://api.github.com/users/nicosaki/following{/other_user}","gists_url":"https://api.github.com/users/nicosaki/gists{/gist_id}","starred_url":"https://api.github.com/users/nicosaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicosaki/subscriptions","organizations_url":"https://api.github.com/users/nicosaki/orgs","repos_url":"https://api.github.com/users/nicosaki/repos","events_url":"https://api.github.com/users/nicosaki/events{/privacy}","received_events_url":"https://api.github.com/users/nicosaki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nicosaki/betsy","description":"","fork":true,"url":"https://api.github.com/repos/nicosaki/betsy","forks_url":"https://api.github.com/repos/nicosaki/betsy/forks","keys_url":"https://api.github.com/repos/nicosaki/betsy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nicosaki/betsy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nicosaki/betsy/teams","hooks_url":"https://api.github.com/repos/nicosaki/betsy/hooks","issue_events_url":"https://api.github.com/repos/nicosaki/betsy/issues/events{/number}","events_url":"https://api.github.com/repos/nicosaki/betsy/events","assignees_url":"https://api.github.com/repos/nicosaki/betsy/assignees{/user}","branches_url":"https://api.github.com/repos/nicosaki/betsy/branches{/branch}","tags_url":"https://api.github.com/repos/nicosaki/betsy/tags","blobs_url":"https://api.github.com/repos/nicosaki/betsy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nicosaki/betsy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nicosaki/betsy/git/refs{/sha}","trees_url":"https://api.github.com/repos/nicosaki/betsy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nicosaki/betsy/statuses/{sha}","languages_url":"https://api.github.com/repos/nicosaki/betsy/languages","stargazers_url":"https://api.github.com/repos/nicosaki/betsy/stargazers","contributors_url":"https://api.github.com/repos/nicosaki/betsy/contributors","subscribers_url":"https://api.github.com/repos/nicosaki/betsy/subscribers","subscription_url":"https://api.github.com/repos/nicosaki/betsy/subscription","commits_url":"https://api.github.com/repos/nicosaki/betsy/commits{/sha}","git_commits_url":"https://api.github.com/repos/nicosaki/betsy/git/commits{/sha}","comments_url":"https://api.github.com/repos/nicosaki/betsy/comments{/number}","issue_comment_url":"https://api.github.com/repos/nicosaki/betsy/issues/comments{/number}","contents_url":"https://api.github.com/repos/nicosaki/betsy/contents/{+path}","compare_url":"https://api.github.com/repos/nicosaki/betsy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nicosaki/betsy/merges","archive_url":"https://api.github.com/repos/nicosaki/betsy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nicosaki/betsy/downloads","issues_url":"https://api.github.com/repos/nicosaki/betsy/issues{/number}","pulls_url":"https://api.github.com/repos/nicosaki/betsy/pulls{/number}","milestones_url":"https://api.github.com/repos/nicosaki/betsy/milestones{/number}","notifications_url":"https://api.github.com/repos/nicosaki/betsy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nicosaki/betsy/labels{/name}","releases_url":"https://api.github.com/repos/nicosaki/betsy/releases{/id}","deployments_url":"https://api.github.com/repos/nicosaki/betsy/deployments","created_at":"2016-05-23T21:22:11Z","updated_at":"2016-05-23T21:22:12Z","pushed_at":"2016-05-27T22:12:41Z","git_url":"git://github.com/nicosaki/betsy.git","ssh_url":"git@github.com:nicosaki/betsy.git","clone_url":"https://github.com/nicosaki/betsy.git","svn_url":"https://github.com/nicosaki/betsy","homepage":null,"size":14119,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sophiabaldonado:master","ref":"master","sha":"f1ee943ec6e6860807838b68be551da079e007cb","user":{"login":"sophiabaldonado","id":1866001,"avatar_url":"https://avatars.githubusercontent.com/u/1866001?v=3","gravatar_id":"","url":"https://api.github.com/users/sophiabaldonado","html_url":"https://github.com/sophiabaldonado","followers_url":"https://api.github.com/users/sophiabaldonado/followers","following_url":"https://api.github.com/users/sophiabaldonado/following{/other_user}","gists_url":"https://api.github.com/users/sophiabaldonado/gists{/gist_id}","starred_url":"https://api.github.com/users/sophiabaldonado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sophiabaldonado/subscriptions","organizations_url":"https://api.github.com/users/sophiabaldonado/orgs","repos_url":"https://api.github.com/users/sophiabaldonado/repos","events_url":"https://api.github.com/users/sophiabaldonado/events{/privacy}","received_events_url":"https://api.github.com/users/sophiabaldonado/received_events","type":"User","site_admin":false},"repo":{"id":57925506,"name":"betsy","full_name":"sophiabaldonado/betsy","owner":{"login":"sophiabaldonado","id":1866001,"avatar_url":"https://avatars.githubusercontent.com/u/1866001?v=3","gravatar_id":"","url":"https://api.github.com/users/sophiabaldonado","html_url":"https://github.com/sophiabaldonado","followers_url":"https://api.github.com/users/sophiabaldonado/followers","following_url":"https://api.github.com/users/sophiabaldonado/following{/other_user}","gists_url":"https://api.github.com/users/sophiabaldonado/gists{/gist_id}","starred_url":"https://api.github.com/users/sophiabaldonado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sophiabaldonado/subscriptions","organizations_url":"https://api.github.com/users/sophiabaldonado/orgs","repos_url":"https://api.github.com/users/sophiabaldonado/repos","events_url":"https://api.github.com/users/sophiabaldonado/events{/privacy}","received_events_url":"https://api.github.com/users/sophiabaldonado/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sophiabaldonado/betsy","description":"","fork":true,"url":"https://api.github.com/repos/sophiabaldonado/betsy","forks_url":"https://api.github.com/repos/sophiabaldonado/betsy/forks","keys_url":"https://api.github.com/repos/sophiabaldonado/betsy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sophiabaldonado/betsy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sophiabaldonado/betsy/teams","hooks_url":"https://api.github.com/repos/sophiabaldonado/betsy/hooks","issue_events_url":"https://api.github.com/repos/sophiabaldonado/betsy/issues/events{/number}","events_url":"https://api.github.com/repos/sophiabaldonado/betsy/events","assignees_url":"https://api.github.com/repos/sophiabaldonado/betsy/assignees{/user}","branches_url":"https://api.github.com/repos/sophiabaldonado/betsy/branches{/branch}","tags_url":"https://api.github.com/repos/sophiabaldonado/betsy/tags","blobs_url":"https://api.github.com/repos/sophiabaldonado/betsy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sophiabaldonado/betsy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sophiabaldonado/betsy/git/refs{/sha}","trees_url":"https://api.github.com/repos/sophiabaldonado/betsy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sophiabaldonado/betsy/statuses/{sha}","languages_url":"https://api.github.com/repos/sophiabaldonado/betsy/languages","stargazers_url":"https://api.github.com/repos/sophiabaldonado/betsy/stargazers","contributors_url":"https://api.github.com/repos/sophiabaldonado/betsy/contributors","subscribers_url":"https://api.github.com/repos/sophiabaldonado/betsy/subscribers","subscription_url":"https://api.github.com/repos/sophiabaldonado/betsy/subscription","commits_url":"https://api.github.com/repos/sophiabaldonado/betsy/commits{/sha}","git_commits_url":"https://api.github.com/repos/sophiabaldonado/betsy/git/commits{/sha}","comments_url":"https://api.github.com/repos/sophiabaldonado/betsy/comments{/number}","issue_comment_url":"https://api.github.com/repos/sophiabaldonado/betsy/issues/comments{/number}","contents_url":"https://api.github.com/repos/sophiabaldonado/betsy/contents/{+path}","compare_url":"https://api.github.com/repos/sophiabaldonado/betsy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sophiabaldonado/betsy/merges","archive_url":"https://api.github.com/repos/sophiabaldonado/betsy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sophiabaldonado/betsy/downloads","issues_url":"https://api.github.com/repos/sophiabaldonado/betsy/issues{/number}","pulls_url":"https://api.github.com/repos/sophiabaldonado/betsy/pulls{/number}","milestones_url":"https://api.github.com/repos/sophiabaldonado/betsy/milestones{/number}","notifications_url":"https://api.github.com/repos/sophiabaldonado/betsy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sophiabaldonado/betsy/labels{/name}","releases_url":"https://api.github.com/repos/sophiabaldonado/betsy/releases{/id}","deployments_url":"https://api.github.com/repos/sophiabaldonado/betsy/deployments","created_at":"2016-05-02T22:34:56Z","updated_at":"2016-05-14T05:07:17Z","pushed_at":"2016-05-27T22:35:49Z","git_url":"git://github.com/sophiabaldonado/betsy.git","ssh_url":"git@github.com:sophiabaldonado/betsy.git","clone_url":"https://github.com/sophiabaldonado/betsy.git","svn_url":"https://github.com/sophiabaldonado/betsy","homepage":null,"size":14136,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sophiabaldonado/betsy/pulls/1"},"html":{"href":"https://github.com/sophiabaldonado/betsy/pull/1"},"issue":{"href":"https://api.github.com/repos/sophiabaldonado/betsy/issues/1"},"comments":{"href":"https://api.github.com/repos/sophiabaldonado/betsy/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/sophiabaldonado/betsy/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/sophiabaldonado/betsy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sophiabaldonado/betsy/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/sophiabaldonado/betsy/statuses/2b37784079c648f094e3e9dea7a0ff48a2f9a5c2"}}}}
{"actor":{"display_login":"TamarHershi"}}