{"action":"created","comment":{"url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/comments/36660220","id":36660220,"diff_hunk":"@@ -0,0 +1,41 @@\n+class CartsController < ApplicationController\n+  def show\n+    @order_items = current_order.order_items\n+\n+    calc_unit_total\n+    calc_order_total\n+  end\n+\n+  def calc_unit_total\n+    @unit_total = 0\n+\n+    @order_items.each do |order_item|\n+      @unit_total += order_item.quantity\n+    end\n+\n+    return @unit_total\n+  end\n+\n+  def calc_order_total\n+    @order_total = 0\n+\n+    @order_items.each do |order_item|\n+      @order_total += order_item.revenue\n+    end\n+\n+    return @order_total\n+  end\n+\n+  def add_to_cart\n+    product = Product.find(params[:id])\n+\n+    params[:product_id] = product.id\n+    @order_item = OrderItem.create(","path":"app/controllers/carts_controller.rb","position":33,"original_position":33,"commit_id":"aa9774af3548018bd2b9f09e9691599c2c1a9367","original_commit_id":"aa9774af3548018bd2b9f09e9691599c2c1a9367","user":{"login":"kariabancroft","id":7269204,"avatar_url":"https://avatars.githubusercontent.com/u/7269204?v=3","gravatar_id":"","url":"https://api.github.com/users/kariabancroft","html_url":"https://github.com/kariabancroft","followers_url":"https://api.github.com/users/kariabancroft/followers","following_url":"https://api.github.com/users/kariabancroft/following{/other_user}","gists_url":"https://api.github.com/users/kariabancroft/gists{/gist_id}","starred_url":"https://api.github.com/users/kariabancroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kariabancroft/subscriptions","organizations_url":"https://api.github.com/users/kariabancroft/orgs","repos_url":"https://api.github.com/users/kariabancroft/repos","events_url":"https://api.github.com/users/kariabancroft/events{/privacy}","received_events_url":"https://api.github.com/users/kariabancroft/received_events","type":"User","site_admin":false},"body":"This creation logic would make more sense in the `OrderItem` model","created_at":"2015-08-10T17:38:49Z","updated_at":"2015-08-10T17:38:49Z","html_url":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy/pull/17#discussion_r36660220","pull_request_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/comments/36660220"},"html":{"href":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy/pull/17#discussion_r36660220"},"pull_request":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/17","id":40822305,"html_url":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy/pull/17","diff_url":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy/pull/17.diff","patch_url":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy/pull/17.patch","issue_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/issues/17","number":17,"state":"open","locked":false,"title":"PRIMO! ","user":{"login":"shannachau","id":7750662,"avatar_url":"https://avatars.githubusercontent.com/u/7750662?v=3","gravatar_id":"","url":"https://api.github.com/users/shannachau","html_url":"https://github.com/shannachau","followers_url":"https://api.github.com/users/shannachau/followers","following_url":"https://api.github.com/users/shannachau/following{/other_user}","gists_url":"https://api.github.com/users/shannachau/gists{/gist_id}","starred_url":"https://api.github.com/users/shannachau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shannachau/subscriptions","organizations_url":"https://api.github.com/users/shannachau/orgs","repos_url":"https://api.github.com/users/shannachau/repos","events_url":"https://api.github.com/users/shannachau/events{/privacy}","received_events_url":"https://api.github.com/users/shannachau/received_events","type":"User","site_admin":false},"body":"https://shop-primo.herokuapp.com/","created_at":"2015-07-24T22:37:48Z","updated_at":"2015-08-10T17:38:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e2b1379dccfb8e33e4417c21640ed06307e05c86","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/17/commits","review_comments_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/17/comments","review_comment_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/issues/17/comments","statuses_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/statuses/aa9774af3548018bd2b9f09e9691599c2c1a9367","head":{"label":"camarleigh:80sAdies/master","ref":"80sAdies/master","sha":"aa9774af3548018bd2b9f09e9691599c2c1a9367","user":{"login":"camarleigh","id":7756186,"avatar_url":"https://avatars.githubusercontent.com/u/7756186?v=3","gravatar_id":"","url":"https://api.github.com/users/camarleigh","html_url":"https://github.com/camarleigh","followers_url":"https://api.github.com/users/camarleigh/followers","following_url":"https://api.github.com/users/camarleigh/following{/other_user}","gists_url":"https://api.github.com/users/camarleigh/gists{/gist_id}","starred_url":"https://api.github.com/users/camarleigh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camarleigh/subscriptions","organizations_url":"https://api.github.com/users/camarleigh/orgs","repos_url":"https://api.github.com/users/camarleigh/repos","events_url":"https://api.github.com/users/camarleigh/events{/privacy}","received_events_url":"https://api.github.com/users/camarleigh/received_events","type":"User","site_admin":false},"repo":{"id":39098563,"name":"C3Projects--bEtsy","full_name":"camarleigh/C3Projects--bEtsy","owner":{"login":"camarleigh","id":7756186,"avatar_url":"https://avatars.githubusercontent.com/u/7756186?v=3","gravatar_id":"","url":"https://api.github.com/users/camarleigh","html_url":"https://github.com/camarleigh","followers_url":"https://api.github.com/users/camarleigh/followers","following_url":"https://api.github.com/users/camarleigh/following{/other_user}","gists_url":"https://api.github.com/users/camarleigh/gists{/gist_id}","starred_url":"https://api.github.com/users/camarleigh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camarleigh/subscriptions","organizations_url":"https://api.github.com/users/camarleigh/orgs","repos_url":"https://api.github.com/users/camarleigh/repos","events_url":"https://api.github.com/users/camarleigh/events{/privacy}","received_events_url":"https://api.github.com/users/camarleigh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/camarleigh/C3Projects--bEtsy","description":"","fork":true,"url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy","forks_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/forks","keys_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/teams","hooks_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/hooks","issue_events_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/issues/events{/number}","events_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/events","assignees_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/assignees{/user}","branches_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/branches{/branch}","tags_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/tags","blobs_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/git/refs{/sha}","trees_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/statuses/{sha}","languages_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/languages","stargazers_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/stargazers","contributors_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/contributors","subscribers_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/subscribers","subscription_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/subscription","commits_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/commits{/sha}","git_commits_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/git/commits{/sha}","comments_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/comments{/number}","issue_comment_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/issues/comments{/number}","contents_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/contents/{+path}","compare_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/merges","archive_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/downloads","issues_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/issues{/number}","pulls_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/pulls{/number}","milestones_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/milestones{/number}","notifications_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/labels{/name}","releases_url":"https://api.github.com/repos/camarleigh/C3Projects--bEtsy/releases{/id}","created_at":"2015-07-14T20:25:19Z","updated_at":"2015-07-13T20:24:12Z","pushed_at":"2015-07-24T21:16:42Z","git_url":"git://github.com/camarleigh/C3Projects--bEtsy.git","ssh_url":"git@github.com:camarleigh/C3Projects--bEtsy.git","clone_url":"https://github.com/camarleigh/C3Projects--bEtsy.git","svn_url":"https://github.com/camarleigh/C3Projects--bEtsy","homepage":null,"size":1261,"stargazers_count":0,"watchers_count":0,"language":null,"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":"Ada-Developers-Academy:80sAdies/master","ref":"80sAdies/master","sha":"24b8058e53981c72eb6a1c4a7aa158e9b8933d35","user":{"login":"Ada-Developers-Academy","id":4689715,"avatar_url":"https://avatars.githubusercontent.com/u/4689715?v=3","gravatar_id":"","url":"https://api.github.com/users/Ada-Developers-Academy","html_url":"https://github.com/Ada-Developers-Academy","followers_url":"https://api.github.com/users/Ada-Developers-Academy/followers","following_url":"https://api.github.com/users/Ada-Developers-Academy/following{/other_user}","gists_url":"https://api.github.com/users/Ada-Developers-Academy/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-Developers-Academy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-Developers-Academy/subscriptions","organizations_url":"https://api.github.com/users/Ada-Developers-Academy/orgs","repos_url":"https://api.github.com/users/Ada-Developers-Academy/repos","events_url":"https://api.github.com/users/Ada-Developers-Academy/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-Developers-Academy/received_events","type":"Organization","site_admin":false},"repo":{"id":39035434,"name":"C3Projects--bEtsy","full_name":"Ada-Developers-Academy/C3Projects--bEtsy","owner":{"login":"Ada-Developers-Academy","id":4689715,"avatar_url":"https://avatars.githubusercontent.com/u/4689715?v=3","gravatar_id":"","url":"https://api.github.com/users/Ada-Developers-Academy","html_url":"https://github.com/Ada-Developers-Academy","followers_url":"https://api.github.com/users/Ada-Developers-Academy/followers","following_url":"https://api.github.com/users/Ada-Developers-Academy/following{/other_user}","gists_url":"https://api.github.com/users/Ada-Developers-Academy/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-Developers-Academy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-Developers-Academy/subscriptions","organizations_url":"https://api.github.com/users/Ada-Developers-Academy/orgs","repos_url":"https://api.github.com/users/Ada-Developers-Academy/repos","events_url":"https://api.github.com/users/Ada-Developers-Academy/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-Developers-Academy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy","description":"","fork":false,"url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy","forks_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/forks","keys_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/teams","hooks_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/hooks","issue_events_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/issues/events{/number}","events_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/events","assignees_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/assignees{/user}","branches_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/branches{/branch}","tags_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/tags","blobs_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/statuses/{sha}","languages_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/languages","stargazers_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/stargazers","contributors_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/contributors","subscribers_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/subscribers","subscription_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/subscription","commits_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/contents/{+path}","compare_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/merges","archive_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/downloads","issues_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/issues{/number}","pulls_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls{/number}","milestones_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/milestones{/number}","notifications_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/labels{/name}","releases_url":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/releases{/id}","created_at":"2015-07-13T20:24:12Z","updated_at":"2015-07-19T07:18:36Z","pushed_at":"2015-07-24T22:50:57Z","git_url":"git://github.com/Ada-Developers-Academy/C3Projects--bEtsy.git","ssh_url":"git@github.com:Ada-Developers-Academy/C3Projects--bEtsy.git","clone_url":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy.git","svn_url":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy","homepage":null,"size":25308,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":6,"forks":8,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/17"},"html":{"href":"https://github.com/Ada-Developers-Academy/C3Projects--bEtsy/pull/17"},"issue":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/issues/17"},"comments":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/Ada-Developers-Academy/C3Projects--bEtsy/statuses/aa9774af3548018bd2b9f09e9691599c2c1a9367"}}}}