{"action":"created","comment":{"url":"https://api.github.com/repos/hexpm/hex_web/pulls/comments/52481730","id":52481730,"diff_hunk":"@@ -6,21 +6,20 @@ defmodule HexWeb.API.DocsController do\n   @uncompressed_max_size 64 * 1024 * 1024\n \n   def show(conn, %{\"name\" => name, \"version\" => version}) do\n-    if (package = HexWeb.Repo.get_by(Package, name: name)) &&\n-       (release = HexWeb.Repo.get_by(assoc(package, :releases), version: version)) do\n-      if release.has_docs do\n-        redirect conn, external: HexWeb.Utils.docs_tarball_url(package, release)\n-      else\n-        not_found(conn)\n-      end\n+    package = HexWeb.Repo.get_by(Package, name: name)","path":"web/controllers/api/docs_controller.ex","position":11,"original_position":11,"commit_id":"e26fc93703923cbc6c0a0005c1964c40948d3988","original_commit_id":"e26fc93703923cbc6c0a0005c1964c40948d3988","user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"body":"This code could likely be moved to a function. At least the package + release fetching.","created_at":"2016-02-10T16:22:57Z","updated_at":"2016-02-10T16:22:57Z","html_url":"https://github.com/hexpm/hex_web/pull/233#discussion_r52481730","pull_request_url":"https://api.github.com/repos/hexpm/hex_web/pulls/233","_links":{"self":{"href":"https://api.github.com/repos/hexpm/hex_web/pulls/comments/52481730"},"html":{"href":"https://github.com/hexpm/hex_web/pull/233#discussion_r52481730"},"pull_request":{"href":"https://api.github.com/repos/hexpm/hex_web/pulls/233"}}},"pull_request":{"url":"https://api.github.com/repos/hexpm/hex_web/pulls/233","id":58913623,"html_url":"https://github.com/hexpm/hex_web/pull/233","diff_url":"https://github.com/hexpm/hex_web/pull/233.diff","patch_url":"https://github.com/hexpm/hex_web/pull/233.patch","issue_url":"https://api.github.com/repos/hexpm/hex_web/issues/233","number":233,"state":"open","locked":false,"title":"Fix elixir 1.3.0-dev warnings","user":{"login":"ericmj","id":316890,"avatar_url":"https://avatars.githubusercontent.com/u/316890?v=3","gravatar_id":"","url":"https://api.github.com/users/ericmj","html_url":"https://github.com/ericmj","followers_url":"https://api.github.com/users/ericmj/followers","following_url":"https://api.github.com/users/ericmj/following{/other_user}","gists_url":"https://api.github.com/users/ericmj/gists{/gist_id}","starred_url":"https://api.github.com/users/ericmj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericmj/subscriptions","organizations_url":"https://api.github.com/users/ericmj/orgs","repos_url":"https://api.github.com/users/ericmj/repos","events_url":"https://api.github.com/users/ericmj/events{/privacy}","received_events_url":"https://api.github.com/users/ericmj/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-10T16:17:58Z","updated_at":"2016-02-10T16:22:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"65e085854162ae774cd5c2ba9f0a291fd0a7230c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hexpm/hex_web/pulls/233/commits","review_comments_url":"https://api.github.com/repos/hexpm/hex_web/pulls/233/comments","review_comment_url":"https://api.github.com/repos/hexpm/hex_web/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hexpm/hex_web/issues/233/comments","statuses_url":"https://api.github.com/repos/hexpm/hex_web/statuses/e26fc93703923cbc6c0a0005c1964c40948d3988","head":{"label":"hexpm:emj-warnings","ref":"emj-warnings","sha":"e26fc93703923cbc6c0a0005c1964c40948d3988","user":{"login":"hexpm","id":6621265,"avatar_url":"https://avatars.githubusercontent.com/u/6621265?v=3","gravatar_id":"","url":"https://api.github.com/users/hexpm","html_url":"https://github.com/hexpm","followers_url":"https://api.github.com/users/hexpm/followers","following_url":"https://api.github.com/users/hexpm/following{/other_user}","gists_url":"https://api.github.com/users/hexpm/gists{/gist_id}","starred_url":"https://api.github.com/users/hexpm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hexpm/subscriptions","organizations_url":"https://api.github.com/users/hexpm/orgs","repos_url":"https://api.github.com/users/hexpm/repos","events_url":"https://api.github.com/users/hexpm/events{/privacy}","received_events_url":"https://api.github.com/users/hexpm/received_events","type":"Organization","site_admin":false},"repo":{"id":16328245,"name":"hex_web","full_name":"hexpm/hex_web","owner":{"login":"hexpm","id":6621265,"avatar_url":"https://avatars.githubusercontent.com/u/6621265?v=3","gravatar_id":"","url":"https://api.github.com/users/hexpm","html_url":"https://github.com/hexpm","followers_url":"https://api.github.com/users/hexpm/followers","following_url":"https://api.github.com/users/hexpm/following{/other_user}","gists_url":"https://api.github.com/users/hexpm/gists{/gist_id}","starred_url":"https://api.github.com/users/hexpm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hexpm/subscriptions","organizations_url":"https://api.github.com/users/hexpm/orgs","repos_url":"https://api.github.com/users/hexpm/repos","events_url":"https://api.github.com/users/hexpm/events{/privacy}","received_events_url":"https://api.github.com/users/hexpm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hexpm/hex_web","description":"API server and website for Hex","fork":false,"url":"https://api.github.com/repos/hexpm/hex_web","forks_url":"https://api.github.com/repos/hexpm/hex_web/forks","keys_url":"https://api.github.com/repos/hexpm/hex_web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hexpm/hex_web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hexpm/hex_web/teams","hooks_url":"https://api.github.com/repos/hexpm/hex_web/hooks","issue_events_url":"https://api.github.com/repos/hexpm/hex_web/issues/events{/number}","events_url":"https://api.github.com/repos/hexpm/hex_web/events","assignees_url":"https://api.github.com/repos/hexpm/hex_web/assignees{/user}","branches_url":"https://api.github.com/repos/hexpm/hex_web/branches{/branch}","tags_url":"https://api.github.com/repos/hexpm/hex_web/tags","blobs_url":"https://api.github.com/repos/hexpm/hex_web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hexpm/hex_web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hexpm/hex_web/git/refs{/sha}","trees_url":"https://api.github.com/repos/hexpm/hex_web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hexpm/hex_web/statuses/{sha}","languages_url":"https://api.github.com/repos/hexpm/hex_web/languages","stargazers_url":"https://api.github.com/repos/hexpm/hex_web/stargazers","contributors_url":"https://api.github.com/repos/hexpm/hex_web/contributors","subscribers_url":"https://api.github.com/repos/hexpm/hex_web/subscribers","subscription_url":"https://api.github.com/repos/hexpm/hex_web/subscription","commits_url":"https://api.github.com/repos/hexpm/hex_web/commits{/sha}","git_commits_url":"https://api.github.com/repos/hexpm/hex_web/git/commits{/sha}","comments_url":"https://api.github.com/repos/hexpm/hex_web/comments{/number}","issue_comment_url":"https://api.github.com/repos/hexpm/hex_web/issues/comments{/number}","contents_url":"https://api.github.com/repos/hexpm/hex_web/contents/{+path}","compare_url":"https://api.github.com/repos/hexpm/hex_web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hexpm/hex_web/merges","archive_url":"https://api.github.com/repos/hexpm/hex_web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hexpm/hex_web/downloads","issues_url":"https://api.github.com/repos/hexpm/hex_web/issues{/number}","pulls_url":"https://api.github.com/repos/hexpm/hex_web/pulls{/number}","milestones_url":"https://api.github.com/repos/hexpm/hex_web/milestones{/number}","notifications_url":"https://api.github.com/repos/hexpm/hex_web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hexpm/hex_web/labels{/name}","releases_url":"https://api.github.com/repos/hexpm/hex_web/releases{/id}","deployments_url":"https://api.github.com/repos/hexpm/hex_web/deployments","created_at":"2014-01-28T22:29:21Z","updated_at":"2016-01-31T23:34:03Z","pushed_at":"2016-02-10T16:20:11Z","git_url":"git://github.com/hexpm/hex_web.git","ssh_url":"git@github.com:hexpm/hex_web.git","clone_url":"https://github.com/hexpm/hex_web.git","svn_url":"https://github.com/hexpm/hex_web","homepage":"https://hex.pm","size":1887,"stargazers_count":121,"watchers_count":121,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":28,"forks":61,"open_issues":28,"watchers":121,"default_branch":"master"}},"base":{"label":"hexpm:master","ref":"master","sha":"9f5ca47e1eaa4f73cd10f8188d75632486de30a7","user":{"login":"hexpm","id":6621265,"avatar_url":"https://avatars.githubusercontent.com/u/6621265?v=3","gravatar_id":"","url":"https://api.github.com/users/hexpm","html_url":"https://github.com/hexpm","followers_url":"https://api.github.com/users/hexpm/followers","following_url":"https://api.github.com/users/hexpm/following{/other_user}","gists_url":"https://api.github.com/users/hexpm/gists{/gist_id}","starred_url":"https://api.github.com/users/hexpm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hexpm/subscriptions","organizations_url":"https://api.github.com/users/hexpm/orgs","repos_url":"https://api.github.com/users/hexpm/repos","events_url":"https://api.github.com/users/hexpm/events{/privacy}","received_events_url":"https://api.github.com/users/hexpm/received_events","type":"Organization","site_admin":false},"repo":{"id":16328245,"name":"hex_web","full_name":"hexpm/hex_web","owner":{"login":"hexpm","id":6621265,"avatar_url":"https://avatars.githubusercontent.com/u/6621265?v=3","gravatar_id":"","url":"https://api.github.com/users/hexpm","html_url":"https://github.com/hexpm","followers_url":"https://api.github.com/users/hexpm/followers","following_url":"https://api.github.com/users/hexpm/following{/other_user}","gists_url":"https://api.github.com/users/hexpm/gists{/gist_id}","starred_url":"https://api.github.com/users/hexpm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hexpm/subscriptions","organizations_url":"https://api.github.com/users/hexpm/orgs","repos_url":"https://api.github.com/users/hexpm/repos","events_url":"https://api.github.com/users/hexpm/events{/privacy}","received_events_url":"https://api.github.com/users/hexpm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hexpm/hex_web","description":"API server and website for Hex","fork":false,"url":"https://api.github.com/repos/hexpm/hex_web","forks_url":"https://api.github.com/repos/hexpm/hex_web/forks","keys_url":"https://api.github.com/repos/hexpm/hex_web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hexpm/hex_web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hexpm/hex_web/teams","hooks_url":"https://api.github.com/repos/hexpm/hex_web/hooks","issue_events_url":"https://api.github.com/repos/hexpm/hex_web/issues/events{/number}","events_url":"https://api.github.com/repos/hexpm/hex_web/events","assignees_url":"https://api.github.com/repos/hexpm/hex_web/assignees{/user}","branches_url":"https://api.github.com/repos/hexpm/hex_web/branches{/branch}","tags_url":"https://api.github.com/repos/hexpm/hex_web/tags","blobs_url":"https://api.github.com/repos/hexpm/hex_web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hexpm/hex_web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hexpm/hex_web/git/refs{/sha}","trees_url":"https://api.github.com/repos/hexpm/hex_web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hexpm/hex_web/statuses/{sha}","languages_url":"https://api.github.com/repos/hexpm/hex_web/languages","stargazers_url":"https://api.github.com/repos/hexpm/hex_web/stargazers","contributors_url":"https://api.github.com/repos/hexpm/hex_web/contributors","subscribers_url":"https://api.github.com/repos/hexpm/hex_web/subscribers","subscription_url":"https://api.github.com/repos/hexpm/hex_web/subscription","commits_url":"https://api.github.com/repos/hexpm/hex_web/commits{/sha}","git_commits_url":"https://api.github.com/repos/hexpm/hex_web/git/commits{/sha}","comments_url":"https://api.github.com/repos/hexpm/hex_web/comments{/number}","issue_comment_url":"https://api.github.com/repos/hexpm/hex_web/issues/comments{/number}","contents_url":"https://api.github.com/repos/hexpm/hex_web/contents/{+path}","compare_url":"https://api.github.com/repos/hexpm/hex_web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hexpm/hex_web/merges","archive_url":"https://api.github.com/repos/hexpm/hex_web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hexpm/hex_web/downloads","issues_url":"https://api.github.com/repos/hexpm/hex_web/issues{/number}","pulls_url":"https://api.github.com/repos/hexpm/hex_web/pulls{/number}","milestones_url":"https://api.github.com/repos/hexpm/hex_web/milestones{/number}","notifications_url":"https://api.github.com/repos/hexpm/hex_web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hexpm/hex_web/labels{/name}","releases_url":"https://api.github.com/repos/hexpm/hex_web/releases{/id}","deployments_url":"https://api.github.com/repos/hexpm/hex_web/deployments","created_at":"2014-01-28T22:29:21Z","updated_at":"2016-01-31T23:34:03Z","pushed_at":"2016-02-10T16:20:11Z","git_url":"git://github.com/hexpm/hex_web.git","ssh_url":"git@github.com:hexpm/hex_web.git","clone_url":"https://github.com/hexpm/hex_web.git","svn_url":"https://github.com/hexpm/hex_web","homepage":"https://hex.pm","size":1887,"stargazers_count":121,"watchers_count":121,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":28,"forks":61,"open_issues":28,"watchers":121,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hexpm/hex_web/pulls/233"},"html":{"href":"https://github.com/hexpm/hex_web/pull/233"},"issue":{"href":"https://api.github.com/repos/hexpm/hex_web/issues/233"},"comments":{"href":"https://api.github.com/repos/hexpm/hex_web/issues/233/comments"},"review_comments":{"href":"https://api.github.com/repos/hexpm/hex_web/pulls/233/comments"},"review_comment":{"href":"https://api.github.com/repos/hexpm/hex_web/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hexpm/hex_web/pulls/233/commits"},"statuses":{"href":"https://api.github.com/repos/hexpm/hex_web/statuses/e26fc93703923cbc6c0a0005c1964c40948d3988"}}}}