{"action":"created","comment":{"url":"https://api.github.com/repos/rubygarage/shareconomy/pulls/comments/66837931","id":66837931,"diff_hunk":"@@ -0,0 +1,37 @@\n+require_dependency \"shareconomy/api/api_controller\"\n+\n+module Shareconomy\n+  class Api::V1::OrdersController < Api::ApiController\n+    before_action :set_listing, only: :create\n+    load_and_authorize_resource class: Order\n+\n+    def sales\n+      render json: Shareconomy::Response.new(@orders)\n+    end\n+\n+    def purchases\n+      render json: Shareconomy::Response.new(@orders)\n+    end\n+\n+    def show\n+      render json: Shareconomy::Response.new(@order)\n+    end\n+\n+    def create\n+      @order.buyer = current_shareconomy_user\n+      @order.listing = @listing\n+      @order.seller = @listing.user\n+      create_entity(@order)\n+    end\n+\n+    private\n+\n+      def set_listing\n+        @listing = Listing.find(params[:order][:listing_id])","path":"app/controllers/shareconomy/api/v1/orders_controller.rb","position":30,"original_position":30,"commit_id":"c4795ebc6e999faba1ad8744f2c30e61027303b3","original_commit_id":"c4795ebc6e999faba1ad8744f2c30e61027303b3","user":{"login":"GeorgeZhukov","id":8019484,"avatar_url":"https://avatars.githubusercontent.com/u/8019484?v=3","gravatar_id":"","url":"https://api.github.com/users/GeorgeZhukov","html_url":"https://github.com/GeorgeZhukov","followers_url":"https://api.github.com/users/GeorgeZhukov/followers","following_url":"https://api.github.com/users/GeorgeZhukov/following{/other_user}","gists_url":"https://api.github.com/users/GeorgeZhukov/gists{/gist_id}","starred_url":"https://api.github.com/users/GeorgeZhukov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeorgeZhukov/subscriptions","organizations_url":"https://api.github.com/users/GeorgeZhukov/orgs","repos_url":"https://api.github.com/users/GeorgeZhukov/repos","events_url":"https://api.github.com/users/GeorgeZhukov/events{/privacy}","received_events_url":"https://api.github.com/users/GeorgeZhukov/received_events","type":"User","site_admin":false},"body":"what about authorize? ","created_at":"2016-06-13T17:59:25Z","updated_at":"2016-06-13T17:59:25Z","html_url":"https://github.com/rubygarage/shareconomy/pull/5#discussion_r66837931","pull_request_url":"https://api.github.com/repos/rubygarage/shareconomy/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/rubygarage/shareconomy/pulls/comments/66837931"},"html":{"href":"https://github.com/rubygarage/shareconomy/pull/5#discussion_r66837931"},"pull_request":{"href":"https://api.github.com/repos/rubygarage/shareconomy/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/rubygarage/shareconomy/pulls/5","id":72892804,"html_url":"https://github.com/rubygarage/shareconomy/pull/5","diff_url":"https://github.com/rubygarage/shareconomy/pull/5.diff","patch_url":"https://github.com/rubygarage/shareconomy/pull/5.patch","issue_url":"https://api.github.com/repos/rubygarage/shareconomy/issues/5","number":5,"state":"open","locked":false,"title":"crud order","user":{"login":"kolyastepanets","id":12134472,"avatar_url":"https://avatars.githubusercontent.com/u/12134472?v=3","gravatar_id":"","url":"https://api.github.com/users/kolyastepanets","html_url":"https://github.com/kolyastepanets","followers_url":"https://api.github.com/users/kolyastepanets/followers","following_url":"https://api.github.com/users/kolyastepanets/following{/other_user}","gists_url":"https://api.github.com/users/kolyastepanets/gists{/gist_id}","starred_url":"https://api.github.com/users/kolyastepanets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kolyastepanets/subscriptions","organizations_url":"https://api.github.com/users/kolyastepanets/orgs","repos_url":"https://api.github.com/users/kolyastepanets/repos","events_url":"https://api.github.com/users/kolyastepanets/events{/privacy}","received_events_url":"https://api.github.com/users/kolyastepanets/received_events","type":"User","site_admin":false},"body":"add crud order","created_at":"2016-06-07T15:08:18Z","updated_at":"2016-06-13T17:59:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f306b81af12d6b455be2dc35efd893d44365bca","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rubygarage/shareconomy/pulls/5/commits","review_comments_url":"https://api.github.com/repos/rubygarage/shareconomy/pulls/5/comments","review_comment_url":"https://api.github.com/repos/rubygarage/shareconomy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rubygarage/shareconomy/issues/5/comments","statuses_url":"https://api.github.com/repos/rubygarage/shareconomy/statuses/c4795ebc6e999faba1ad8744f2c30e61027303b3","head":{"label":"rubygarage:crud_order","ref":"crud_order","sha":"c4795ebc6e999faba1ad8744f2c30e61027303b3","user":{"login":"rubygarage","id":2300590,"avatar_url":"https://avatars.githubusercontent.com/u/2300590?v=3","gravatar_id":"","url":"https://api.github.com/users/rubygarage","html_url":"https://github.com/rubygarage","followers_url":"https://api.github.com/users/rubygarage/followers","following_url":"https://api.github.com/users/rubygarage/following{/other_user}","gists_url":"https://api.github.com/users/rubygarage/gists{/gist_id}","starred_url":"https://api.github.com/users/rubygarage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubygarage/subscriptions","organizations_url":"https://api.github.com/users/rubygarage/orgs","repos_url":"https://api.github.com/users/rubygarage/repos","events_url":"https://api.github.com/users/rubygarage/events{/privacy}","received_events_url":"https://api.github.com/users/rubygarage/received_events","type":"Organization","site_admin":false},"repo":{"id":60172156,"name":"shareconomy","full_name":"rubygarage/shareconomy","owner":{"login":"rubygarage","id":2300590,"avatar_url":"https://avatars.githubusercontent.com/u/2300590?v=3","gravatar_id":"","url":"https://api.github.com/users/rubygarage","html_url":"https://github.com/rubygarage","followers_url":"https://api.github.com/users/rubygarage/followers","following_url":"https://api.github.com/users/rubygarage/following{/other_user}","gists_url":"https://api.github.com/users/rubygarage/gists{/gist_id}","starred_url":"https://api.github.com/users/rubygarage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubygarage/subscriptions","organizations_url":"https://api.github.com/users/rubygarage/orgs","repos_url":"https://api.github.com/users/rubygarage/repos","events_url":"https://api.github.com/users/rubygarage/events{/privacy}","received_events_url":"https://api.github.com/users/rubygarage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rubygarage/shareconomy","description":"","fork":false,"url":"https://api.github.com/repos/rubygarage/shareconomy","forks_url":"https://api.github.com/repos/rubygarage/shareconomy/forks","keys_url":"https://api.github.com/repos/rubygarage/shareconomy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rubygarage/shareconomy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rubygarage/shareconomy/teams","hooks_url":"https://api.github.com/repos/rubygarage/shareconomy/hooks","issue_events_url":"https://api.github.com/repos/rubygarage/shareconomy/issues/events{/number}","events_url":"https://api.github.com/repos/rubygarage/shareconomy/events","assignees_url":"https://api.github.com/repos/rubygarage/shareconomy/assignees{/user}","branches_url":"https://api.github.com/repos/rubygarage/shareconomy/branches{/branch}","tags_url":"https://api.github.com/repos/rubygarage/shareconomy/tags","blobs_url":"https://api.github.com/repos/rubygarage/shareconomy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rubygarage/shareconomy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rubygarage/shareconomy/git/refs{/sha}","trees_url":"https://api.github.com/repos/rubygarage/shareconomy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rubygarage/shareconomy/statuses/{sha}","languages_url":"https://api.github.com/repos/rubygarage/shareconomy/languages","stargazers_url":"https://api.github.com/repos/rubygarage/shareconomy/stargazers","contributors_url":"https://api.github.com/repos/rubygarage/shareconomy/contributors","subscribers_url":"https://api.github.com/repos/rubygarage/shareconomy/subscribers","subscription_url":"https://api.github.com/repos/rubygarage/shareconomy/subscription","commits_url":"https://api.github.com/repos/rubygarage/shareconomy/commits{/sha}","git_commits_url":"https://api.github.com/repos/rubygarage/shareconomy/git/commits{/sha}","comments_url":"https://api.github.com/repos/rubygarage/shareconomy/comments{/number}","issue_comment_url":"https://api.github.com/repos/rubygarage/shareconomy/issues/comments{/number}","contents_url":"https://api.github.com/repos/rubygarage/shareconomy/contents/{+path}","compare_url":"https://api.github.com/repos/rubygarage/shareconomy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rubygarage/shareconomy/merges","archive_url":"https://api.github.com/repos/rubygarage/shareconomy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rubygarage/shareconomy/downloads","issues_url":"https://api.github.com/repos/rubygarage/shareconomy/issues{/number}","pulls_url":"https://api.github.com/repos/rubygarage/shareconomy/pulls{/number}","milestones_url":"https://api.github.com/repos/rubygarage/shareconomy/milestones{/number}","notifications_url":"https://api.github.com/repos/rubygarage/shareconomy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rubygarage/shareconomy/labels{/name}","releases_url":"https://api.github.com/repos/rubygarage/shareconomy/releases{/id}","deployments_url":"https://api.github.com/repos/rubygarage/shareconomy/deployments","created_at":"2016-06-01T11:46:12Z","updated_at":"2016-06-02T13:26:13Z","pushed_at":"2016-06-13T09:47:46Z","git_url":"git://github.com/rubygarage/shareconomy.git","ssh_url":"git@github.com:rubygarage/shareconomy.git","clone_url":"https://github.com/rubygarage/shareconomy.git","svn_url":"https://github.com/rubygarage/shareconomy","homepage":null,"size":54,"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":"rubygarage:master","ref":"master","sha":"6dc724a2487811054e7b4ec43377d6c9f7a10abd","user":{"login":"rubygarage","id":2300590,"avatar_url":"https://avatars.githubusercontent.com/u/2300590?v=3","gravatar_id":"","url":"https://api.github.com/users/rubygarage","html_url":"https://github.com/rubygarage","followers_url":"https://api.github.com/users/rubygarage/followers","following_url":"https://api.github.com/users/rubygarage/following{/other_user}","gists_url":"https://api.github.com/users/rubygarage/gists{/gist_id}","starred_url":"https://api.github.com/users/rubygarage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubygarage/subscriptions","organizations_url":"https://api.github.com/users/rubygarage/orgs","repos_url":"https://api.github.com/users/rubygarage/repos","events_url":"https://api.github.com/users/rubygarage/events{/privacy}","received_events_url":"https://api.github.com/users/rubygarage/received_events","type":"Organization","site_admin":false},"repo":{"id":60172156,"name":"shareconomy","full_name":"rubygarage/shareconomy","owner":{"login":"rubygarage","id":2300590,"avatar_url":"https://avatars.githubusercontent.com/u/2300590?v=3","gravatar_id":"","url":"https://api.github.com/users/rubygarage","html_url":"https://github.com/rubygarage","followers_url":"https://api.github.com/users/rubygarage/followers","following_url":"https://api.github.com/users/rubygarage/following{/other_user}","gists_url":"https://api.github.com/users/rubygarage/gists{/gist_id}","starred_url":"https://api.github.com/users/rubygarage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubygarage/subscriptions","organizations_url":"https://api.github.com/users/rubygarage/orgs","repos_url":"https://api.github.com/users/rubygarage/repos","events_url":"https://api.github.com/users/rubygarage/events{/privacy}","received_events_url":"https://api.github.com/users/rubygarage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rubygarage/shareconomy","description":"","fork":false,"url":"https://api.github.com/repos/rubygarage/shareconomy","forks_url":"https://api.github.com/repos/rubygarage/shareconomy/forks","keys_url":"https://api.github.com/repos/rubygarage/shareconomy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rubygarage/shareconomy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rubygarage/shareconomy/teams","hooks_url":"https://api.github.com/repos/rubygarage/shareconomy/hooks","issue_events_url":"https://api.github.com/repos/rubygarage/shareconomy/issues/events{/number}","events_url":"https://api.github.com/repos/rubygarage/shareconomy/events","assignees_url":"https://api.github.com/repos/rubygarage/shareconomy/assignees{/user}","branches_url":"https://api.github.com/repos/rubygarage/shareconomy/branches{/branch}","tags_url":"https://api.github.com/repos/rubygarage/shareconomy/tags","blobs_url":"https://api.github.com/repos/rubygarage/shareconomy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rubygarage/shareconomy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rubygarage/shareconomy/git/refs{/sha}","trees_url":"https://api.github.com/repos/rubygarage/shareconomy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rubygarage/shareconomy/statuses/{sha}","languages_url":"https://api.github.com/repos/rubygarage/shareconomy/languages","stargazers_url":"https://api.github.com/repos/rubygarage/shareconomy/stargazers","contributors_url":"https://api.github.com/repos/rubygarage/shareconomy/contributors","subscribers_url":"https://api.github.com/repos/rubygarage/shareconomy/subscribers","subscription_url":"https://api.github.com/repos/rubygarage/shareconomy/subscription","commits_url":"https://api.github.com/repos/rubygarage/shareconomy/commits{/sha}","git_commits_url":"https://api.github.com/repos/rubygarage/shareconomy/git/commits{/sha}","comments_url":"https://api.github.com/repos/rubygarage/shareconomy/comments{/number}","issue_comment_url":"https://api.github.com/repos/rubygarage/shareconomy/issues/comments{/number}","contents_url":"https://api.github.com/repos/rubygarage/shareconomy/contents/{+path}","compare_url":"https://api.github.com/repos/rubygarage/shareconomy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rubygarage/shareconomy/merges","archive_url":"https://api.github.com/repos/rubygarage/shareconomy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rubygarage/shareconomy/downloads","issues_url":"https://api.github.com/repos/rubygarage/shareconomy/issues{/number}","pulls_url":"https://api.github.com/repos/rubygarage/shareconomy/pulls{/number}","milestones_url":"https://api.github.com/repos/rubygarage/shareconomy/milestones{/number}","notifications_url":"https://api.github.com/repos/rubygarage/shareconomy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rubygarage/shareconomy/labels{/name}","releases_url":"https://api.github.com/repos/rubygarage/shareconomy/releases{/id}","deployments_url":"https://api.github.com/repos/rubygarage/shareconomy/deployments","created_at":"2016-06-01T11:46:12Z","updated_at":"2016-06-02T13:26:13Z","pushed_at":"2016-06-13T09:47:46Z","git_url":"git://github.com/rubygarage/shareconomy.git","ssh_url":"git@github.com:rubygarage/shareconomy.git","clone_url":"https://github.com/rubygarage/shareconomy.git","svn_url":"https://github.com/rubygarage/shareconomy","homepage":null,"size":54,"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/rubygarage/shareconomy/pulls/5"},"html":{"href":"https://github.com/rubygarage/shareconomy/pull/5"},"issue":{"href":"https://api.github.com/repos/rubygarage/shareconomy/issues/5"},"comments":{"href":"https://api.github.com/repos/rubygarage/shareconomy/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/rubygarage/shareconomy/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/rubygarage/shareconomy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rubygarage/shareconomy/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/rubygarage/shareconomy/statuses/c4795ebc6e999faba1ad8744f2c30e61027303b3"}}}}
{"actor":{"display_login":"GeorgeZhukov"}}