{"action":"created","comment":{"url":"https://api.github.com/repos/tomohung/myflix/pulls/comments/27719227","id":27719227,"diff_hunk":"@@ -17,7 +18,12 @@ def create\n   end\n \n   def show\n-    @user = User.find(params[:id])\n+    @user = User.find_by_token(params[:id])","path":"app/controllers/users_controller.rb","position":16,"original_position":16,"commit_id":"314d8ed3a4ccbbe63b0e8b340a7dfeb799ebfb53","original_commit_id":"314d8ed3a4ccbbe63b0e8b340a7dfeb799ebfb53","user":{"login":"tomtomecek","id":7385469,"avatar_url":"https://avatars.githubusercontent.com/u/7385469?v=3","gravatar_id":"","url":"https://api.github.com/users/tomtomecek","html_url":"https://github.com/tomtomecek","followers_url":"https://api.github.com/users/tomtomecek/followers","following_url":"https://api.github.com/users/tomtomecek/following{/other_user}","gists_url":"https://api.github.com/users/tomtomecek/gists{/gist_id}","starred_url":"https://api.github.com/users/tomtomecek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomtomecek/subscriptions","organizations_url":"https://api.github.com/users/tomtomecek/orgs","repos_url":"https://api.github.com/users/tomtomecek/repos","events_url":"https://api.github.com/users/tomtomecek/events{/privacy}","received_events_url":"https://api.github.com/users/tomtomecek/received_events","type":"User","site_admin":false},"body":"`find_by_token` is very ineffective because it goes through `method_missing`. I suggest using standard `.find_by` - in this case `.find_by(token: params[:id])`.","created_at":"2015-04-03T07:50:59Z","updated_at":"2015-04-03T07:50:59Z","html_url":"https://github.com/tomohung/myflix/pull/12#discussion_r27719227","pull_request_url":"https://api.github.com/repos/tomohung/myflix/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/tomohung/myflix/pulls/comments/27719227"},"html":{"href":"https://github.com/tomohung/myflix/pull/12#discussion_r27719227"},"pull_request":{"href":"https://api.github.com/repos/tomohung/myflix/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/tomohung/myflix/pulls/12","id":32566965,"html_url":"https://github.com/tomohung/myflix/pull/12","diff_url":"https://github.com/tomohung/myflix/pull/12.diff","patch_url":"https://github.com/tomohung/myflix/pull/12.patch","issue_url":"https://api.github.com/repos/tomohung/myflix/issues/12","number":12,"state":"open","locked":false,"title":"Sending email","user":{"login":"tomohung","id":3352926,"avatar_url":"https://avatars.githubusercontent.com/u/3352926?v=3","gravatar_id":"","url":"https://api.github.com/users/tomohung","html_url":"https://github.com/tomohung","followers_url":"https://api.github.com/users/tomohung/followers","following_url":"https://api.github.com/users/tomohung/following{/other_user}","gists_url":"https://api.github.com/users/tomohung/gists{/gist_id}","starred_url":"https://api.github.com/users/tomohung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomohung/subscriptions","organizations_url":"https://api.github.com/users/tomohung/orgs","repos_url":"https://api.github.com/users/tomohung/repos","events_url":"https://api.github.com/users/tomohung/events{/privacy}","received_events_url":"https://api.github.com/users/tomohung/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-03T02:49:51Z","updated_at":"2015-04-03T07:50:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a53831f50cbf6970cdc99e52ee11f2b3a22b713a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tomohung/myflix/pulls/12/commits","review_comments_url":"https://api.github.com/repos/tomohung/myflix/pulls/12/comments","review_comment_url":"https://api.github.com/repos/tomohung/myflix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tomohung/myflix/issues/12/comments","statuses_url":"https://api.github.com/repos/tomohung/myflix/statuses/314d8ed3a4ccbbe63b0e8b340a7dfeb799ebfb53","head":{"label":"tomohung:sending_email","ref":"sending_email","sha":"314d8ed3a4ccbbe63b0e8b340a7dfeb799ebfb53","user":{"login":"tomohung","id":3352926,"avatar_url":"https://avatars.githubusercontent.com/u/3352926?v=3","gravatar_id":"","url":"https://api.github.com/users/tomohung","html_url":"https://github.com/tomohung","followers_url":"https://api.github.com/users/tomohung/followers","following_url":"https://api.github.com/users/tomohung/following{/other_user}","gists_url":"https://api.github.com/users/tomohung/gists{/gist_id}","starred_url":"https://api.github.com/users/tomohung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomohung/subscriptions","organizations_url":"https://api.github.com/users/tomohung/orgs","repos_url":"https://api.github.com/users/tomohung/repos","events_url":"https://api.github.com/users/tomohung/events{/privacy}","received_events_url":"https://api.github.com/users/tomohung/received_events","type":"User","site_admin":false},"repo":{"id":31462876,"name":"myflix","full_name":"tomohung/myflix","owner":{"login":"tomohung","id":3352926,"avatar_url":"https://avatars.githubusercontent.com/u/3352926?v=3","gravatar_id":"","url":"https://api.github.com/users/tomohung","html_url":"https://github.com/tomohung","followers_url":"https://api.github.com/users/tomohung/followers","following_url":"https://api.github.com/users/tomohung/following{/other_user}","gists_url":"https://api.github.com/users/tomohung/gists{/gist_id}","starred_url":"https://api.github.com/users/tomohung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomohung/subscriptions","organizations_url":"https://api.github.com/users/tomohung/orgs","repos_url":"https://api.github.com/users/tomohung/repos","events_url":"https://api.github.com/users/tomohung/events{/privacy}","received_events_url":"https://api.github.com/users/tomohung/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tomohung/myflix","description":"","fork":false,"url":"https://api.github.com/repos/tomohung/myflix","forks_url":"https://api.github.com/repos/tomohung/myflix/forks","keys_url":"https://api.github.com/repos/tomohung/myflix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tomohung/myflix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tomohung/myflix/teams","hooks_url":"https://api.github.com/repos/tomohung/myflix/hooks","issue_events_url":"https://api.github.com/repos/tomohung/myflix/issues/events{/number}","events_url":"https://api.github.com/repos/tomohung/myflix/events","assignees_url":"https://api.github.com/repos/tomohung/myflix/assignees{/user}","branches_url":"https://api.github.com/repos/tomohung/myflix/branches{/branch}","tags_url":"https://api.github.com/repos/tomohung/myflix/tags","blobs_url":"https://api.github.com/repos/tomohung/myflix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tomohung/myflix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tomohung/myflix/git/refs{/sha}","trees_url":"https://api.github.com/repos/tomohung/myflix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tomohung/myflix/statuses/{sha}","languages_url":"https://api.github.com/repos/tomohung/myflix/languages","stargazers_url":"https://api.github.com/repos/tomohung/myflix/stargazers","contributors_url":"https://api.github.com/repos/tomohung/myflix/contributors","subscribers_url":"https://api.github.com/repos/tomohung/myflix/subscribers","subscription_url":"https://api.github.com/repos/tomohung/myflix/subscription","commits_url":"https://api.github.com/repos/tomohung/myflix/commits{/sha}","git_commits_url":"https://api.github.com/repos/tomohung/myflix/git/commits{/sha}","comments_url":"https://api.github.com/repos/tomohung/myflix/comments{/number}","issue_comment_url":"https://api.github.com/repos/tomohung/myflix/issues/comments{/number}","contents_url":"https://api.github.com/repos/tomohung/myflix/contents/{+path}","compare_url":"https://api.github.com/repos/tomohung/myflix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tomohung/myflix/merges","archive_url":"https://api.github.com/repos/tomohung/myflix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tomohung/myflix/downloads","issues_url":"https://api.github.com/repos/tomohung/myflix/issues{/number}","pulls_url":"https://api.github.com/repos/tomohung/myflix/pulls{/number}","milestones_url":"https://api.github.com/repos/tomohung/myflix/milestones{/number}","notifications_url":"https://api.github.com/repos/tomohung/myflix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tomohung/myflix/labels{/name}","releases_url":"https://api.github.com/repos/tomohung/myflix/releases{/id}","created_at":"2015-02-28T13:06:58Z","updated_at":"2015-04-01T22:51:46Z","pushed_at":"2015-04-03T02:49:51Z","git_url":"git://github.com/tomohung/myflix.git","ssh_url":"git@github.com:tomohung/myflix.git","clone_url":"https://github.com/tomohung/myflix.git","svn_url":"https://github.com/tomohung/myflix","homepage":null,"size":528,"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":"tomohung:master","ref":"master","sha":"ddcefb3f698ef604a256e56132475d3e1b9669c1","user":{"login":"tomohung","id":3352926,"avatar_url":"https://avatars.githubusercontent.com/u/3352926?v=3","gravatar_id":"","url":"https://api.github.com/users/tomohung","html_url":"https://github.com/tomohung","followers_url":"https://api.github.com/users/tomohung/followers","following_url":"https://api.github.com/users/tomohung/following{/other_user}","gists_url":"https://api.github.com/users/tomohung/gists{/gist_id}","starred_url":"https://api.github.com/users/tomohung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomohung/subscriptions","organizations_url":"https://api.github.com/users/tomohung/orgs","repos_url":"https://api.github.com/users/tomohung/repos","events_url":"https://api.github.com/users/tomohung/events{/privacy}","received_events_url":"https://api.github.com/users/tomohung/received_events","type":"User","site_admin":false},"repo":{"id":31462876,"name":"myflix","full_name":"tomohung/myflix","owner":{"login":"tomohung","id":3352926,"avatar_url":"https://avatars.githubusercontent.com/u/3352926?v=3","gravatar_id":"","url":"https://api.github.com/users/tomohung","html_url":"https://github.com/tomohung","followers_url":"https://api.github.com/users/tomohung/followers","following_url":"https://api.github.com/users/tomohung/following{/other_user}","gists_url":"https://api.github.com/users/tomohung/gists{/gist_id}","starred_url":"https://api.github.com/users/tomohung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomohung/subscriptions","organizations_url":"https://api.github.com/users/tomohung/orgs","repos_url":"https://api.github.com/users/tomohung/repos","events_url":"https://api.github.com/users/tomohung/events{/privacy}","received_events_url":"https://api.github.com/users/tomohung/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tomohung/myflix","description":"","fork":false,"url":"https://api.github.com/repos/tomohung/myflix","forks_url":"https://api.github.com/repos/tomohung/myflix/forks","keys_url":"https://api.github.com/repos/tomohung/myflix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tomohung/myflix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tomohung/myflix/teams","hooks_url":"https://api.github.com/repos/tomohung/myflix/hooks","issue_events_url":"https://api.github.com/repos/tomohung/myflix/issues/events{/number}","events_url":"https://api.github.com/repos/tomohung/myflix/events","assignees_url":"https://api.github.com/repos/tomohung/myflix/assignees{/user}","branches_url":"https://api.github.com/repos/tomohung/myflix/branches{/branch}","tags_url":"https://api.github.com/repos/tomohung/myflix/tags","blobs_url":"https://api.github.com/repos/tomohung/myflix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tomohung/myflix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tomohung/myflix/git/refs{/sha}","trees_url":"https://api.github.com/repos/tomohung/myflix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tomohung/myflix/statuses/{sha}","languages_url":"https://api.github.com/repos/tomohung/myflix/languages","stargazers_url":"https://api.github.com/repos/tomohung/myflix/stargazers","contributors_url":"https://api.github.com/repos/tomohung/myflix/contributors","subscribers_url":"https://api.github.com/repos/tomohung/myflix/subscribers","subscription_url":"https://api.github.com/repos/tomohung/myflix/subscription","commits_url":"https://api.github.com/repos/tomohung/myflix/commits{/sha}","git_commits_url":"https://api.github.com/repos/tomohung/myflix/git/commits{/sha}","comments_url":"https://api.github.com/repos/tomohung/myflix/comments{/number}","issue_comment_url":"https://api.github.com/repos/tomohung/myflix/issues/comments{/number}","contents_url":"https://api.github.com/repos/tomohung/myflix/contents/{+path}","compare_url":"https://api.github.com/repos/tomohung/myflix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tomohung/myflix/merges","archive_url":"https://api.github.com/repos/tomohung/myflix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tomohung/myflix/downloads","issues_url":"https://api.github.com/repos/tomohung/myflix/issues{/number}","pulls_url":"https://api.github.com/repos/tomohung/myflix/pulls{/number}","milestones_url":"https://api.github.com/repos/tomohung/myflix/milestones{/number}","notifications_url":"https://api.github.com/repos/tomohung/myflix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tomohung/myflix/labels{/name}","releases_url":"https://api.github.com/repos/tomohung/myflix/releases{/id}","created_at":"2015-02-28T13:06:58Z","updated_at":"2015-04-01T22:51:46Z","pushed_at":"2015-04-03T02:49:51Z","git_url":"git://github.com/tomohung/myflix.git","ssh_url":"git@github.com:tomohung/myflix.git","clone_url":"https://github.com/tomohung/myflix.git","svn_url":"https://github.com/tomohung/myflix","homepage":null,"size":528,"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/tomohung/myflix/pulls/12"},"html":{"href":"https://github.com/tomohung/myflix/pull/12"},"issue":{"href":"https://api.github.com/repos/tomohung/myflix/issues/12"},"comments":{"href":"https://api.github.com/repos/tomohung/myflix/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/tomohung/myflix/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/tomohung/myflix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tomohung/myflix/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/tomohung/myflix/statuses/314d8ed3a4ccbbe63b0e8b340a7dfeb799ebfb53"}}}}