{"action":"created","comment":{"url":"https://api.github.com/repos/railstour/shopoza/pulls/comments/47439245","id":47439245,"diff_hunk":"@@ -0,0 +1,64 @@\n+class OrdersController < ApplicationController\n+  def index\n+    @orders = Order.for_user(current_user)\n+  end\n+\n+  def show\n+    @order = Order.find(params[:id])\n+  end\n+\n+  def no_cart\n+    flash[:alert] = 'you have not put anything in the cart'\n+    redirect_to root_path\n+  end\n+\n+  def create\n+    if current_user.present?\n+      order = find_order\n+      if order.blank?\n+        params[:alert] = \"This Order is not belongs to you\"\n+        redirect_to :back\n+        return\n+      end\n+\n+      if !params[:order_detail][:quantity].to_s.match(/\\A[+-]?\\d+?(\\.\\d+)?\\Z/) || params[:order_detail][:quantity].to_i < 0","path":"app/controllers/orders_controller.rb","position":24,"original_position":24,"commit_id":"2d0f78c4f25563abe72787b929cf9e19ede0ae31","original_commit_id":"547ece0108485632c3f0972fc4f472a34d54afc4","user":{"login":"wendy0402","id":4647969,"avatar_url":"https://avatars.githubusercontent.com/u/4647969?v=3","gravatar_id":"","url":"https://api.github.com/users/wendy0402","html_url":"https://github.com/wendy0402","followers_url":"https://api.github.com/users/wendy0402/followers","following_url":"https://api.github.com/users/wendy0402/following{/other_user}","gists_url":"https://api.github.com/users/wendy0402/gists{/gist_id}","starred_url":"https://api.github.com/users/wendy0402/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wendy0402/subscriptions","organizations_url":"https://api.github.com/users/wendy0402/orgs","repos_url":"https://api.github.com/users/wendy0402/repos","events_url":"https://api.github.com/users/wendy0402/events{/privacy}","received_events_url":"https://api.github.com/users/wendy0402/received_events","type":"User","site_admin":false},"body":"try `12e1`.to_i, and you will know why","created_at":"2015-12-13T01:42:21Z","updated_at":"2015-12-13T01:42:21Z","html_url":"https://github.com/railstour/shopoza/pull/5#discussion_r47439245","pull_request_url":"https://api.github.com/repos/railstour/shopoza/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/railstour/shopoza/pulls/comments/47439245"},"html":{"href":"https://github.com/railstour/shopoza/pull/5#discussion_r47439245"},"pull_request":{"href":"https://api.github.com/repos/railstour/shopoza/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/railstour/shopoza/pulls/5","id":53479788,"html_url":"https://github.com/railstour/shopoza/pull/5","diff_url":"https://github.com/railstour/shopoza/pull/5.diff","patch_url":"https://github.com/railstour/shopoza/pull/5.patch","issue_url":"https://api.github.com/repos/railstour/shopoza/issues/5","number":5,"state":"open","locked":false,"title":"3-add-cart-system","user":{"login":"wendy0402","id":4647969,"avatar_url":"https://avatars.githubusercontent.com/u/4647969?v=3","gravatar_id":"","url":"https://api.github.com/users/wendy0402","html_url":"https://github.com/wendy0402","followers_url":"https://api.github.com/users/wendy0402/followers","following_url":"https://api.github.com/users/wendy0402/following{/other_user}","gists_url":"https://api.github.com/users/wendy0402/gists{/gist_id}","starred_url":"https://api.github.com/users/wendy0402/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wendy0402/subscriptions","organizations_url":"https://api.github.com/users/wendy0402/orgs","repos_url":"https://api.github.com/users/wendy0402/repos","events_url":"https://api.github.com/users/wendy0402/events{/privacy}","received_events_url":"https://api.github.com/users/wendy0402/received_events","type":"User","site_admin":false},"body":null,"created_at":"2015-12-12T16:34:31Z","updated_at":"2015-12-13T01:42:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6bb71c95d7b06ce576ca88e1f31f6f6bb35189c4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/railstour/shopoza/pulls/5/commits","review_comments_url":"https://api.github.com/repos/railstour/shopoza/pulls/5/comments","review_comment_url":"https://api.github.com/repos/railstour/shopoza/pulls/comments{/number}","comments_url":"https://api.github.com/repos/railstour/shopoza/issues/5/comments","statuses_url":"https://api.github.com/repos/railstour/shopoza/statuses/2d0f78c4f25563abe72787b929cf9e19ede0ae31","head":{"label":"railstour:3-add-cart-system","ref":"3-add-cart-system","sha":"2d0f78c4f25563abe72787b929cf9e19ede0ae31","user":{"login":"railstour","id":16048098,"avatar_url":"https://avatars.githubusercontent.com/u/16048098?v=3","gravatar_id":"","url":"https://api.github.com/users/railstour","html_url":"https://github.com/railstour","followers_url":"https://api.github.com/users/railstour/followers","following_url":"https://api.github.com/users/railstour/following{/other_user}","gists_url":"https://api.github.com/users/railstour/gists{/gist_id}","starred_url":"https://api.github.com/users/railstour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/railstour/subscriptions","organizations_url":"https://api.github.com/users/railstour/orgs","repos_url":"https://api.github.com/users/railstour/repos","events_url":"https://api.github.com/users/railstour/events{/privacy}","received_events_url":"https://api.github.com/users/railstour/received_events","type":"Organization","site_admin":false},"repo":{"id":47003200,"name":"shopoza","full_name":"railstour/shopoza","owner":{"login":"railstour","id":16048098,"avatar_url":"https://avatars.githubusercontent.com/u/16048098?v=3","gravatar_id":"","url":"https://api.github.com/users/railstour","html_url":"https://github.com/railstour","followers_url":"https://api.github.com/users/railstour/followers","following_url":"https://api.github.com/users/railstour/following{/other_user}","gists_url":"https://api.github.com/users/railstour/gists{/gist_id}","starred_url":"https://api.github.com/users/railstour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/railstour/subscriptions","organizations_url":"https://api.github.com/users/railstour/orgs","repos_url":"https://api.github.com/users/railstour/repos","events_url":"https://api.github.com/users/railstour/events{/privacy}","received_events_url":"https://api.github.com/users/railstour/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/railstour/shopoza","description":"The Next-Big e-Commerce Website in Indonesia","fork":false,"url":"https://api.github.com/repos/railstour/shopoza","forks_url":"https://api.github.com/repos/railstour/shopoza/forks","keys_url":"https://api.github.com/repos/railstour/shopoza/keys{/key_id}","collaborators_url":"https://api.github.com/repos/railstour/shopoza/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/railstour/shopoza/teams","hooks_url":"https://api.github.com/repos/railstour/shopoza/hooks","issue_events_url":"https://api.github.com/repos/railstour/shopoza/issues/events{/number}","events_url":"https://api.github.com/repos/railstour/shopoza/events","assignees_url":"https://api.github.com/repos/railstour/shopoza/assignees{/user}","branches_url":"https://api.github.com/repos/railstour/shopoza/branches{/branch}","tags_url":"https://api.github.com/repos/railstour/shopoza/tags","blobs_url":"https://api.github.com/repos/railstour/shopoza/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/railstour/shopoza/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/railstour/shopoza/git/refs{/sha}","trees_url":"https://api.github.com/repos/railstour/shopoza/git/trees{/sha}","statuses_url":"https://api.github.com/repos/railstour/shopoza/statuses/{sha}","languages_url":"https://api.github.com/repos/railstour/shopoza/languages","stargazers_url":"https://api.github.com/repos/railstour/shopoza/stargazers","contributors_url":"https://api.github.com/repos/railstour/shopoza/contributors","subscribers_url":"https://api.github.com/repos/railstour/shopoza/subscribers","subscription_url":"https://api.github.com/repos/railstour/shopoza/subscription","commits_url":"https://api.github.com/repos/railstour/shopoza/commits{/sha}","git_commits_url":"https://api.github.com/repos/railstour/shopoza/git/commits{/sha}","comments_url":"https://api.github.com/repos/railstour/shopoza/comments{/number}","issue_comment_url":"https://api.github.com/repos/railstour/shopoza/issues/comments{/number}","contents_url":"https://api.github.com/repos/railstour/shopoza/contents/{+path}","compare_url":"https://api.github.com/repos/railstour/shopoza/compare/{base}...{head}","merges_url":"https://api.github.com/repos/railstour/shopoza/merges","archive_url":"https://api.github.com/repos/railstour/shopoza/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/railstour/shopoza/downloads","issues_url":"https://api.github.com/repos/railstour/shopoza/issues{/number}","pulls_url":"https://api.github.com/repos/railstour/shopoza/pulls{/number}","milestones_url":"https://api.github.com/repos/railstour/shopoza/milestones{/number}","notifications_url":"https://api.github.com/repos/railstour/shopoza/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/railstour/shopoza/labels{/name}","releases_url":"https://api.github.com/repos/railstour/shopoza/releases{/id}","created_at":"2015-11-27T23:33:04Z","updated_at":"2015-11-29T01:39:56Z","pushed_at":"2015-12-13T00:18:07Z","git_url":"git://github.com/railstour/shopoza.git","ssh_url":"git@github.com:railstour/shopoza.git","clone_url":"https://github.com/railstour/shopoza.git","svn_url":"https://github.com/railstour/shopoza","homepage":null,"size":151,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"railstour:master","ref":"master","sha":"a0a378503f27fdd6a21561bd3777597b6a71e850","user":{"login":"railstour","id":16048098,"avatar_url":"https://avatars.githubusercontent.com/u/16048098?v=3","gravatar_id":"","url":"https://api.github.com/users/railstour","html_url":"https://github.com/railstour","followers_url":"https://api.github.com/users/railstour/followers","following_url":"https://api.github.com/users/railstour/following{/other_user}","gists_url":"https://api.github.com/users/railstour/gists{/gist_id}","starred_url":"https://api.github.com/users/railstour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/railstour/subscriptions","organizations_url":"https://api.github.com/users/railstour/orgs","repos_url":"https://api.github.com/users/railstour/repos","events_url":"https://api.github.com/users/railstour/events{/privacy}","received_events_url":"https://api.github.com/users/railstour/received_events","type":"Organization","site_admin":false},"repo":{"id":47003200,"name":"shopoza","full_name":"railstour/shopoza","owner":{"login":"railstour","id":16048098,"avatar_url":"https://avatars.githubusercontent.com/u/16048098?v=3","gravatar_id":"","url":"https://api.github.com/users/railstour","html_url":"https://github.com/railstour","followers_url":"https://api.github.com/users/railstour/followers","following_url":"https://api.github.com/users/railstour/following{/other_user}","gists_url":"https://api.github.com/users/railstour/gists{/gist_id}","starred_url":"https://api.github.com/users/railstour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/railstour/subscriptions","organizations_url":"https://api.github.com/users/railstour/orgs","repos_url":"https://api.github.com/users/railstour/repos","events_url":"https://api.github.com/users/railstour/events{/privacy}","received_events_url":"https://api.github.com/users/railstour/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/railstour/shopoza","description":"The Next-Big e-Commerce Website in Indonesia","fork":false,"url":"https://api.github.com/repos/railstour/shopoza","forks_url":"https://api.github.com/repos/railstour/shopoza/forks","keys_url":"https://api.github.com/repos/railstour/shopoza/keys{/key_id}","collaborators_url":"https://api.github.com/repos/railstour/shopoza/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/railstour/shopoza/teams","hooks_url":"https://api.github.com/repos/railstour/shopoza/hooks","issue_events_url":"https://api.github.com/repos/railstour/shopoza/issues/events{/number}","events_url":"https://api.github.com/repos/railstour/shopoza/events","assignees_url":"https://api.github.com/repos/railstour/shopoza/assignees{/user}","branches_url":"https://api.github.com/repos/railstour/shopoza/branches{/branch}","tags_url":"https://api.github.com/repos/railstour/shopoza/tags","blobs_url":"https://api.github.com/repos/railstour/shopoza/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/railstour/shopoza/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/railstour/shopoza/git/refs{/sha}","trees_url":"https://api.github.com/repos/railstour/shopoza/git/trees{/sha}","statuses_url":"https://api.github.com/repos/railstour/shopoza/statuses/{sha}","languages_url":"https://api.github.com/repos/railstour/shopoza/languages","stargazers_url":"https://api.github.com/repos/railstour/shopoza/stargazers","contributors_url":"https://api.github.com/repos/railstour/shopoza/contributors","subscribers_url":"https://api.github.com/repos/railstour/shopoza/subscribers","subscription_url":"https://api.github.com/repos/railstour/shopoza/subscription","commits_url":"https://api.github.com/repos/railstour/shopoza/commits{/sha}","git_commits_url":"https://api.github.com/repos/railstour/shopoza/git/commits{/sha}","comments_url":"https://api.github.com/repos/railstour/shopoza/comments{/number}","issue_comment_url":"https://api.github.com/repos/railstour/shopoza/issues/comments{/number}","contents_url":"https://api.github.com/repos/railstour/shopoza/contents/{+path}","compare_url":"https://api.github.com/repos/railstour/shopoza/compare/{base}...{head}","merges_url":"https://api.github.com/repos/railstour/shopoza/merges","archive_url":"https://api.github.com/repos/railstour/shopoza/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/railstour/shopoza/downloads","issues_url":"https://api.github.com/repos/railstour/shopoza/issues{/number}","pulls_url":"https://api.github.com/repos/railstour/shopoza/pulls{/number}","milestones_url":"https://api.github.com/repos/railstour/shopoza/milestones{/number}","notifications_url":"https://api.github.com/repos/railstour/shopoza/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/railstour/shopoza/labels{/name}","releases_url":"https://api.github.com/repos/railstour/shopoza/releases{/id}","created_at":"2015-11-27T23:33:04Z","updated_at":"2015-11-29T01:39:56Z","pushed_at":"2015-12-13T00:18:07Z","git_url":"git://github.com/railstour/shopoza.git","ssh_url":"git@github.com:railstour/shopoza.git","clone_url":"https://github.com/railstour/shopoza.git","svn_url":"https://github.com/railstour/shopoza","homepage":null,"size":151,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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/railstour/shopoza/pulls/5"},"html":{"href":"https://github.com/railstour/shopoza/pull/5"},"issue":{"href":"https://api.github.com/repos/railstour/shopoza/issues/5"},"comments":{"href":"https://api.github.com/repos/railstour/shopoza/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/railstour/shopoza/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/railstour/shopoza/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/railstour/shopoza/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/railstour/shopoza/statuses/2d0f78c4f25563abe72787b929cf9e19ede0ae31"}}}}