{"action":"created","comment":{"url":"https://api.github.com/repos/hiphip90/QnA/pulls/comments/30524743","id":30524743,"diff_hunk":"@@ -0,0 +1,22 @@\n+class Api::V1::ProfilesController < ApplicationController\n+  before_action :doorkeeper_authorize!\n+  respond_to :json\n+\n+  def me\n+    respond_with(current_resource_owner)\n+  end\n+\n+  def all\n+    respond_with(users_except_owner)\n+  end\n+\n+  protected\n+\n+    def current_resource_owner\n+      @current_resource_owner ||= User.find(doorkeeper_token.resource_owner_id) if doorkeeper_token\n+    end\n+\n+    def users_except_owner\n+      User.all - [current_resource_owner]","path":"app/controllers/api/v1/profiles_controller.rb","position":20,"original_position":20,"commit_id":"6c032f90bba43c9b3fc09aa6a07e1aa8903a15f5","original_commit_id":"6c032f90bba43c9b3fc09aa6a07e1aa8903a15f5","user":{"login":"palkan","id":1516722,"avatar_url":"https://avatars.githubusercontent.com/u/1516722?v=3","gravatar_id":"","url":"https://api.github.com/users/palkan","html_url":"https://github.com/palkan","followers_url":"https://api.github.com/users/palkan/followers","following_url":"https://api.github.com/users/palkan/following{/other_user}","gists_url":"https://api.github.com/users/palkan/gists{/gist_id}","starred_url":"https://api.github.com/users/palkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palkan/subscriptions","organizations_url":"https://api.github.com/users/palkan/orgs","repos_url":"https://api.github.com/users/palkan/repos","events_url":"https://api.github.com/users/palkan/events{/privacy}","received_events_url":"https://api.github.com/users/palkan/received_events","type":"User","site_admin":false},"body":"Не очень красивое решение.\r\nВо-первых, лучше вынести это в модель (например, `User.all_but_one(user)`).\r\nВо-вторых, исключить текущего пользователя можно прямо в запросе.","created_at":"2015-05-18T16:40:39Z","updated_at":"2015-05-18T16:40:39Z","html_url":"https://github.com/hiphip90/QnA/pull/12#discussion_r30524743","pull_request_url":"https://api.github.com/repos/hiphip90/QnA/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/hiphip90/QnA/pulls/comments/30524743"},"html":{"href":"https://github.com/hiphip90/QnA/pull/12#discussion_r30524743"},"pull_request":{"href":"https://api.github.com/repos/hiphip90/QnA/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/hiphip90/QnA/pulls/12","id":35649723,"html_url":"https://github.com/hiphip90/QnA/pull/12","diff_url":"https://github.com/hiphip90/QnA/pull/12.diff","patch_url":"https://github.com/hiphip90/QnA/pull/12.patch","issue_url":"https://api.github.com/repos/hiphip90/QnA/issues/12","number":12,"state":"open","locked":false,"title":"Implement api v1","user":{"login":"hiphip90","id":6410329,"avatar_url":"https://avatars.githubusercontent.com/u/6410329?v=3","gravatar_id":"","url":"https://api.github.com/users/hiphip90","html_url":"https://github.com/hiphip90","followers_url":"https://api.github.com/users/hiphip90/followers","following_url":"https://api.github.com/users/hiphip90/following{/other_user}","gists_url":"https://api.github.com/users/hiphip90/gists{/gist_id}","starred_url":"https://api.github.com/users/hiphip90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiphip90/subscriptions","organizations_url":"https://api.github.com/users/hiphip90/orgs","repos_url":"https://api.github.com/users/hiphip90/repos","events_url":"https://api.github.com/users/hiphip90/events{/privacy}","received_events_url":"https://api.github.com/users/hiphip90/received_events","type":"User","site_admin":false},"body":"14 задание","created_at":"2015-05-18T16:21:02Z","updated_at":"2015-05-18T16:40:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f06d803768c80be0ebf5be76dc423c064e53f4c2","assignee":{"login":"palkan","id":1516722,"avatar_url":"https://avatars.githubusercontent.com/u/1516722?v=3","gravatar_id":"","url":"https://api.github.com/users/palkan","html_url":"https://github.com/palkan","followers_url":"https://api.github.com/users/palkan/followers","following_url":"https://api.github.com/users/palkan/following{/other_user}","gists_url":"https://api.github.com/users/palkan/gists{/gist_id}","starred_url":"https://api.github.com/users/palkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palkan/subscriptions","organizations_url":"https://api.github.com/users/palkan/orgs","repos_url":"https://api.github.com/users/palkan/repos","events_url":"https://api.github.com/users/palkan/events{/privacy}","received_events_url":"https://api.github.com/users/palkan/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/hiphip90/QnA/pulls/12/commits","review_comments_url":"https://api.github.com/repos/hiphip90/QnA/pulls/12/comments","review_comment_url":"https://api.github.com/repos/hiphip90/QnA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hiphip90/QnA/issues/12/comments","statuses_url":"https://api.github.com/repos/hiphip90/QnA/statuses/6c032f90bba43c9b3fc09aa6a07e1aa8903a15f5","head":{"label":"hiphip90:rest-api","ref":"rest-api","sha":"6c032f90bba43c9b3fc09aa6a07e1aa8903a15f5","user":{"login":"hiphip90","id":6410329,"avatar_url":"https://avatars.githubusercontent.com/u/6410329?v=3","gravatar_id":"","url":"https://api.github.com/users/hiphip90","html_url":"https://github.com/hiphip90","followers_url":"https://api.github.com/users/hiphip90/followers","following_url":"https://api.github.com/users/hiphip90/following{/other_user}","gists_url":"https://api.github.com/users/hiphip90/gists{/gist_id}","starred_url":"https://api.github.com/users/hiphip90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiphip90/subscriptions","organizations_url":"https://api.github.com/users/hiphip90/orgs","repos_url":"https://api.github.com/users/hiphip90/repos","events_url":"https://api.github.com/users/hiphip90/events{/privacy}","received_events_url":"https://api.github.com/users/hiphip90/received_events","type":"User","site_admin":false},"repo":{"id":31916485,"name":"QnA","full_name":"hiphip90/QnA","owner":{"login":"hiphip90","id":6410329,"avatar_url":"https://avatars.githubusercontent.com/u/6410329?v=3","gravatar_id":"","url":"https://api.github.com/users/hiphip90","html_url":"https://github.com/hiphip90","followers_url":"https://api.github.com/users/hiphip90/followers","following_url":"https://api.github.com/users/hiphip90/following{/other_user}","gists_url":"https://api.github.com/users/hiphip90/gists{/gist_id}","starred_url":"https://api.github.com/users/hiphip90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiphip90/subscriptions","organizations_url":"https://api.github.com/users/hiphip90/orgs","repos_url":"https://api.github.com/users/hiphip90/repos","events_url":"https://api.github.com/users/hiphip90/events{/privacy}","received_events_url":"https://api.github.com/users/hiphip90/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hiphip90/QnA","description":"StackOverflow clone made for training","fork":false,"url":"https://api.github.com/repos/hiphip90/QnA","forks_url":"https://api.github.com/repos/hiphip90/QnA/forks","keys_url":"https://api.github.com/repos/hiphip90/QnA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hiphip90/QnA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hiphip90/QnA/teams","hooks_url":"https://api.github.com/repos/hiphip90/QnA/hooks","issue_events_url":"https://api.github.com/repos/hiphip90/QnA/issues/events{/number}","events_url":"https://api.github.com/repos/hiphip90/QnA/events","assignees_url":"https://api.github.com/repos/hiphip90/QnA/assignees{/user}","branches_url":"https://api.github.com/repos/hiphip90/QnA/branches{/branch}","tags_url":"https://api.github.com/repos/hiphip90/QnA/tags","blobs_url":"https://api.github.com/repos/hiphip90/QnA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hiphip90/QnA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hiphip90/QnA/git/refs{/sha}","trees_url":"https://api.github.com/repos/hiphip90/QnA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hiphip90/QnA/statuses/{sha}","languages_url":"https://api.github.com/repos/hiphip90/QnA/languages","stargazers_url":"https://api.github.com/repos/hiphip90/QnA/stargazers","contributors_url":"https://api.github.com/repos/hiphip90/QnA/contributors","subscribers_url":"https://api.github.com/repos/hiphip90/QnA/subscribers","subscription_url":"https://api.github.com/repos/hiphip90/QnA/subscription","commits_url":"https://api.github.com/repos/hiphip90/QnA/commits{/sha}","git_commits_url":"https://api.github.com/repos/hiphip90/QnA/git/commits{/sha}","comments_url":"https://api.github.com/repos/hiphip90/QnA/comments{/number}","issue_comment_url":"https://api.github.com/repos/hiphip90/QnA/issues/comments{/number}","contents_url":"https://api.github.com/repos/hiphip90/QnA/contents/{+path}","compare_url":"https://api.github.com/repos/hiphip90/QnA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hiphip90/QnA/merges","archive_url":"https://api.github.com/repos/hiphip90/QnA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hiphip90/QnA/downloads","issues_url":"https://api.github.com/repos/hiphip90/QnA/issues{/number}","pulls_url":"https://api.github.com/repos/hiphip90/QnA/pulls{/number}","milestones_url":"https://api.github.com/repos/hiphip90/QnA/milestones{/number}","notifications_url":"https://api.github.com/repos/hiphip90/QnA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hiphip90/QnA/labels{/name}","releases_url":"https://api.github.com/repos/hiphip90/QnA/releases{/id}","created_at":"2015-03-09T18:53:00Z","updated_at":"2015-05-04T07:53:39Z","pushed_at":"2015-05-18T16:21:03Z","git_url":"git://github.com/hiphip90/QnA.git","ssh_url":"git@github.com:hiphip90/QnA.git","clone_url":"https://github.com/hiphip90/QnA.git","svn_url":"https://github.com/hiphip90/QnA","homepage":null,"size":668,"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":"hiphip90:master","ref":"master","sha":"4562ced46fec89a18c5edd701e8d3cddbbcf1f50","user":{"login":"hiphip90","id":6410329,"avatar_url":"https://avatars.githubusercontent.com/u/6410329?v=3","gravatar_id":"","url":"https://api.github.com/users/hiphip90","html_url":"https://github.com/hiphip90","followers_url":"https://api.github.com/users/hiphip90/followers","following_url":"https://api.github.com/users/hiphip90/following{/other_user}","gists_url":"https://api.github.com/users/hiphip90/gists{/gist_id}","starred_url":"https://api.github.com/users/hiphip90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiphip90/subscriptions","organizations_url":"https://api.github.com/users/hiphip90/orgs","repos_url":"https://api.github.com/users/hiphip90/repos","events_url":"https://api.github.com/users/hiphip90/events{/privacy}","received_events_url":"https://api.github.com/users/hiphip90/received_events","type":"User","site_admin":false},"repo":{"id":31916485,"name":"QnA","full_name":"hiphip90/QnA","owner":{"login":"hiphip90","id":6410329,"avatar_url":"https://avatars.githubusercontent.com/u/6410329?v=3","gravatar_id":"","url":"https://api.github.com/users/hiphip90","html_url":"https://github.com/hiphip90","followers_url":"https://api.github.com/users/hiphip90/followers","following_url":"https://api.github.com/users/hiphip90/following{/other_user}","gists_url":"https://api.github.com/users/hiphip90/gists{/gist_id}","starred_url":"https://api.github.com/users/hiphip90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiphip90/subscriptions","organizations_url":"https://api.github.com/users/hiphip90/orgs","repos_url":"https://api.github.com/users/hiphip90/repos","events_url":"https://api.github.com/users/hiphip90/events{/privacy}","received_events_url":"https://api.github.com/users/hiphip90/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hiphip90/QnA","description":"StackOverflow clone made for training","fork":false,"url":"https://api.github.com/repos/hiphip90/QnA","forks_url":"https://api.github.com/repos/hiphip90/QnA/forks","keys_url":"https://api.github.com/repos/hiphip90/QnA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hiphip90/QnA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hiphip90/QnA/teams","hooks_url":"https://api.github.com/repos/hiphip90/QnA/hooks","issue_events_url":"https://api.github.com/repos/hiphip90/QnA/issues/events{/number}","events_url":"https://api.github.com/repos/hiphip90/QnA/events","assignees_url":"https://api.github.com/repos/hiphip90/QnA/assignees{/user}","branches_url":"https://api.github.com/repos/hiphip90/QnA/branches{/branch}","tags_url":"https://api.github.com/repos/hiphip90/QnA/tags","blobs_url":"https://api.github.com/repos/hiphip90/QnA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hiphip90/QnA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hiphip90/QnA/git/refs{/sha}","trees_url":"https://api.github.com/repos/hiphip90/QnA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hiphip90/QnA/statuses/{sha}","languages_url":"https://api.github.com/repos/hiphip90/QnA/languages","stargazers_url":"https://api.github.com/repos/hiphip90/QnA/stargazers","contributors_url":"https://api.github.com/repos/hiphip90/QnA/contributors","subscribers_url":"https://api.github.com/repos/hiphip90/QnA/subscribers","subscription_url":"https://api.github.com/repos/hiphip90/QnA/subscription","commits_url":"https://api.github.com/repos/hiphip90/QnA/commits{/sha}","git_commits_url":"https://api.github.com/repos/hiphip90/QnA/git/commits{/sha}","comments_url":"https://api.github.com/repos/hiphip90/QnA/comments{/number}","issue_comment_url":"https://api.github.com/repos/hiphip90/QnA/issues/comments{/number}","contents_url":"https://api.github.com/repos/hiphip90/QnA/contents/{+path}","compare_url":"https://api.github.com/repos/hiphip90/QnA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hiphip90/QnA/merges","archive_url":"https://api.github.com/repos/hiphip90/QnA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hiphip90/QnA/downloads","issues_url":"https://api.github.com/repos/hiphip90/QnA/issues{/number}","pulls_url":"https://api.github.com/repos/hiphip90/QnA/pulls{/number}","milestones_url":"https://api.github.com/repos/hiphip90/QnA/milestones{/number}","notifications_url":"https://api.github.com/repos/hiphip90/QnA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hiphip90/QnA/labels{/name}","releases_url":"https://api.github.com/repos/hiphip90/QnA/releases{/id}","created_at":"2015-03-09T18:53:00Z","updated_at":"2015-05-04T07:53:39Z","pushed_at":"2015-05-18T16:21:03Z","git_url":"git://github.com/hiphip90/QnA.git","ssh_url":"git@github.com:hiphip90/QnA.git","clone_url":"https://github.com/hiphip90/QnA.git","svn_url":"https://github.com/hiphip90/QnA","homepage":null,"size":668,"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/hiphip90/QnA/pulls/12"},"html":{"href":"https://github.com/hiphip90/QnA/pull/12"},"issue":{"href":"https://api.github.com/repos/hiphip90/QnA/issues/12"},"comments":{"href":"https://api.github.com/repos/hiphip90/QnA/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/hiphip90/QnA/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/hiphip90/QnA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hiphip90/QnA/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/hiphip90/QnA/statuses/6c032f90bba43c9b3fc09aa6a07e1aa8903a15f5"}}}}