{"action":"created","comment":{"url":"https://api.github.com/repos/katsu105/chat-space/pulls/comments/232132404","pull_request_review_id":173261632,"id":232132404,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjEzMjQwNA==","diff_hunk":"@@ -25,25 +25,23 @@ function buildHTML(message) {\n   }\n \n     var interval = setInterval(function() {\n+\n       if (window.location.href.match(/\\/groups\\/\\d+\\/messages/)) {\n-      var message_id = $('.main__chatcomments').last().data('message-id');\n+      var messageLastId = $('.main__chatcomments:last').data('message-id');","path":"app/assets/javascripts/update-messages.js","position":7,"original_position":7,"commit_id":"a023a40e3ce294b1a521ab4a280dc2195736c582","original_commit_id":"a023a40e3ce294b1a521ab4a280dc2195736c582","user":{"login":"kohei-isoda","id":33193077,"node_id":"MDQ6VXNlcjMzMTkzMDc3","avatar_url":"https://avatars3.githubusercontent.com/u/33193077?v=4","gravatar_id":"","url":"https://api.github.com/users/kohei-isoda","html_url":"https://github.com/kohei-isoda","followers_url":"https://api.github.com/users/kohei-isoda/followers","following_url":"https://api.github.com/users/kohei-isoda/following{/other_user}","gists_url":"https://api.github.com/users/kohei-isoda/gists{/gist_id}","starred_url":"https://api.github.com/users/kohei-isoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kohei-isoda/subscriptions","organizations_url":"https://api.github.com/users/kohei-isoda/orgs","repos_url":"https://api.github.com/users/kohei-isoda/repos","events_url":"https://api.github.com/users/kohei-isoda/events{/privacy}","received_events_url":"https://api.github.com/users/kohei-isoda/received_events","type":"User","site_admin":false},"body":"これ答えになってしまうかもしれませんが、勝山さんのおっしゃる通り、\r\n1番の書き方が正解です！書き方は以下のようになるかと思います。\r\n```\r\nvar messageLastId = $('.main__chatcomments:last').data('message-id') || 0\r\n```\r\nこうすると、idがないときは0を入れてくれるようになります！","created_at":"2018-11-09T03:14:35Z","updated_at":"2018-11-09T03:14:35Z","html_url":"https://github.com/katsu105/chat-space/pull/16#discussion_r232132404","pull_request_url":"https://api.github.com/repos/katsu105/chat-space/pulls/16","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/katsu105/chat-space/pulls/comments/232132404"},"html":{"href":"https://github.com/katsu105/chat-space/pull/16#discussion_r232132404"},"pull_request":{"href":"https://api.github.com/repos/katsu105/chat-space/pulls/16"}},"in_reply_to_id":231825366},"pull_request":{"url":"https://api.github.com/repos/katsu105/chat-space/pulls/16","id":229304197,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5MzA0MTk3","html_url":"https://github.com/katsu105/chat-space/pull/16","diff_url":"https://github.com/katsu105/chat-space/pull/16.diff","patch_url":"https://github.com/katsu105/chat-space/pull/16.patch","issue_url":"https://api.github.com/repos/katsu105/chat-space/issues/16","number":16,"state":"open","locked":false,"title":"コミットやり直し","user":{"login":"katsu105","id":37255570,"node_id":"MDQ6VXNlcjM3MjU1NTcw","avatar_url":"https://avatars2.githubusercontent.com/u/37255570?v=4","gravatar_id":"","url":"https://api.github.com/users/katsu105","html_url":"https://github.com/katsu105","followers_url":"https://api.github.com/users/katsu105/followers","following_url":"https://api.github.com/users/katsu105/following{/other_user}","gists_url":"https://api.github.com/users/katsu105/gists{/gist_id}","starred_url":"https://api.github.com/users/katsu105/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katsu105/subscriptions","organizations_url":"https://api.github.com/users/katsu105/orgs","repos_url":"https://api.github.com/users/katsu105/repos","events_url":"https://api.github.com/users/katsu105/events{/privacy}","received_events_url":"https://api.github.com/users/katsu105/received_events","type":"User","site_admin":false},"body":"# 修正点\r\nidの差異を読み取る記述をcontrollerr側で記述しました。\r\n\r\n## テキストのみ送信した場合\r\n<a href=\"https://gyazo.com/aafe9024db03960e5c16dfca77dac026\"><img src=\"https://i.gyazo.com/aafe9024db03960e5c16dfca77dac026.gif\" alt=\"Image from Gyazo\" width=\"960\"/></a>\r\n\r\n## テキストと画像を送信した場合\r\n<a href=\"https://gyazo.com/299949a51ac5abc0bb353e7d0c2660e9\"><img src=\"https://i.gyazo.com/299949a51ac5abc0bb353e7d0c2660e9.gif\" alt=\"Image from Gyazo\" width=\"960\"/></a>\r\n\r\n## 不安な点\r\nうまく送れてはいるのですが、ロジックの記述に自信がありません。","created_at":"2018-11-08T09:47:25Z","updated_at":"2018-11-09T03:14:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4bd852bdc3736c44b02118989b90096eb823467a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/katsu105/chat-space/pulls/16/commits","review_comments_url":"https://api.github.com/repos/katsu105/chat-space/pulls/16/comments","review_comment_url":"https://api.github.com/repos/katsu105/chat-space/pulls/comments{/number}","comments_url":"https://api.github.com/repos/katsu105/chat-space/issues/16/comments","statuses_url":"https://api.github.com/repos/katsu105/chat-space/statuses/a023a40e3ce294b1a521ab4a280dc2195736c582","head":{"label":"katsu105:add-correction","ref":"add-correction","sha":"a023a40e3ce294b1a521ab4a280dc2195736c582","user":{"login":"katsu105","id":37255570,"node_id":"MDQ6VXNlcjM3MjU1NTcw","avatar_url":"https://avatars2.githubusercontent.com/u/37255570?v=4","gravatar_id":"","url":"https://api.github.com/users/katsu105","html_url":"https://github.com/katsu105","followers_url":"https://api.github.com/users/katsu105/followers","following_url":"https://api.github.com/users/katsu105/following{/other_user}","gists_url":"https://api.github.com/users/katsu105/gists{/gist_id}","starred_url":"https://api.github.com/users/katsu105/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katsu105/subscriptions","organizations_url":"https://api.github.com/users/katsu105/orgs","repos_url":"https://api.github.com/users/katsu105/repos","events_url":"https://api.github.com/users/katsu105/events{/privacy}","received_events_url":"https://api.github.com/users/katsu105/received_events","type":"User","site_admin":false},"repo":{"id":151057969,"node_id":"MDEwOlJlcG9zaXRvcnkxNTEwNTc5Njk=","name":"chat-space","full_name":"katsu105/chat-space","private":false,"owner":{"login":"katsu105","id":37255570,"node_id":"MDQ6VXNlcjM3MjU1NTcw","avatar_url":"https://avatars2.githubusercontent.com/u/37255570?v=4","gravatar_id":"","url":"https://api.github.com/users/katsu105","html_url":"https://github.com/katsu105","followers_url":"https://api.github.com/users/katsu105/followers","following_url":"https://api.github.com/users/katsu105/following{/other_user}","gists_url":"https://api.github.com/users/katsu105/gists{/gist_id}","starred_url":"https://api.github.com/users/katsu105/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katsu105/subscriptions","organizations_url":"https://api.github.com/users/katsu105/orgs","repos_url":"https://api.github.com/users/katsu105/repos","events_url":"https://api.github.com/users/katsu105/events{/privacy}","received_events_url":"https://api.github.com/users/katsu105/received_events","type":"User","site_admin":false},"html_url":"https://github.com/katsu105/chat-space","description":null,"fork":false,"url":"https://api.github.com/repos/katsu105/chat-space","forks_url":"https://api.github.com/repos/katsu105/chat-space/forks","keys_url":"https://api.github.com/repos/katsu105/chat-space/keys{/key_id}","collaborators_url":"https://api.github.com/repos/katsu105/chat-space/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/katsu105/chat-space/teams","hooks_url":"https://api.github.com/repos/katsu105/chat-space/hooks","issue_events_url":"https://api.github.com/repos/katsu105/chat-space/issues/events{/number}","events_url":"https://api.github.com/repos/katsu105/chat-space/events","assignees_url":"https://api.github.com/repos/katsu105/chat-space/assignees{/user}","branches_url":"https://api.github.com/repos/katsu105/chat-space/branches{/branch}","tags_url":"https://api.github.com/repos/katsu105/chat-space/tags","blobs_url":"https://api.github.com/repos/katsu105/chat-space/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/katsu105/chat-space/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/katsu105/chat-space/git/refs{/sha}","trees_url":"https://api.github.com/repos/katsu105/chat-space/git/trees{/sha}","statuses_url":"https://api.github.com/repos/katsu105/chat-space/statuses/{sha}","languages_url":"https://api.github.com/repos/katsu105/chat-space/languages","stargazers_url":"https://api.github.com/repos/katsu105/chat-space/stargazers","contributors_url":"https://api.github.com/repos/katsu105/chat-space/contributors","subscribers_url":"https://api.github.com/repos/katsu105/chat-space/subscribers","subscription_url":"https://api.github.com/repos/katsu105/chat-space/subscription","commits_url":"https://api.github.com/repos/katsu105/chat-space/commits{/sha}","git_commits_url":"https://api.github.com/repos/katsu105/chat-space/git/commits{/sha}","comments_url":"https://api.github.com/repos/katsu105/chat-space/comments{/number}","issue_comment_url":"https://api.github.com/repos/katsu105/chat-space/issues/comments{/number}","contents_url":"https://api.github.com/repos/katsu105/chat-space/contents/{+path}","compare_url":"https://api.github.com/repos/katsu105/chat-space/compare/{base}...{head}","merges_url":"https://api.github.com/repos/katsu105/chat-space/merges","archive_url":"https://api.github.com/repos/katsu105/chat-space/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/katsu105/chat-space/downloads","issues_url":"https://api.github.com/repos/katsu105/chat-space/issues{/number}","pulls_url":"https://api.github.com/repos/katsu105/chat-space/pulls{/number}","milestones_url":"https://api.github.com/repos/katsu105/chat-space/milestones{/number}","notifications_url":"https://api.github.com/repos/katsu105/chat-space/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/katsu105/chat-space/labels{/name}","releases_url":"https://api.github.com/repos/katsu105/chat-space/releases{/id}","deployments_url":"https://api.github.com/repos/katsu105/chat-space/deployments","created_at":"2018-10-01T08:31:09Z","updated_at":"2018-11-08T02:02:21Z","pushed_at":"2018-11-08T09:47:26Z","git_url":"git://github.com/katsu105/chat-space.git","ssh_url":"git@github.com:katsu105/chat-space.git","clone_url":"https://github.com/katsu105/chat-space.git","svn_url":"https://github.com/katsu105/chat-space","homepage":null,"size":301,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"katsu105:master","ref":"master","sha":"481170c0110a7232b61a7c1b8307e5897115a437","user":{"login":"katsu105","id":37255570,"node_id":"MDQ6VXNlcjM3MjU1NTcw","avatar_url":"https://avatars2.githubusercontent.com/u/37255570?v=4","gravatar_id":"","url":"https://api.github.com/users/katsu105","html_url":"https://github.com/katsu105","followers_url":"https://api.github.com/users/katsu105/followers","following_url":"https://api.github.com/users/katsu105/following{/other_user}","gists_url":"https://api.github.com/users/katsu105/gists{/gist_id}","starred_url":"https://api.github.com/users/katsu105/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katsu105/subscriptions","organizations_url":"https://api.github.com/users/katsu105/orgs","repos_url":"https://api.github.com/users/katsu105/repos","events_url":"https://api.github.com/users/katsu105/events{/privacy}","received_events_url":"https://api.github.com/users/katsu105/received_events","type":"User","site_admin":false},"repo":{"id":151057969,"node_id":"MDEwOlJlcG9zaXRvcnkxNTEwNTc5Njk=","name":"chat-space","full_name":"katsu105/chat-space","private":false,"owner":{"login":"katsu105","id":37255570,"node_id":"MDQ6VXNlcjM3MjU1NTcw","avatar_url":"https://avatars2.githubusercontent.com/u/37255570?v=4","gravatar_id":"","url":"https://api.github.com/users/katsu105","html_url":"https://github.com/katsu105","followers_url":"https://api.github.com/users/katsu105/followers","following_url":"https://api.github.com/users/katsu105/following{/other_user}","gists_url":"https://api.github.com/users/katsu105/gists{/gist_id}","starred_url":"https://api.github.com/users/katsu105/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katsu105/subscriptions","organizations_url":"https://api.github.com/users/katsu105/orgs","repos_url":"https://api.github.com/users/katsu105/repos","events_url":"https://api.github.com/users/katsu105/events{/privacy}","received_events_url":"https://api.github.com/users/katsu105/received_events","type":"User","site_admin":false},"html_url":"https://github.com/katsu105/chat-space","description":null,"fork":false,"url":"https://api.github.com/repos/katsu105/chat-space","forks_url":"https://api.github.com/repos/katsu105/chat-space/forks","keys_url":"https://api.github.com/repos/katsu105/chat-space/keys{/key_id}","collaborators_url":"https://api.github.com/repos/katsu105/chat-space/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/katsu105/chat-space/teams","hooks_url":"https://api.github.com/repos/katsu105/chat-space/hooks","issue_events_url":"https://api.github.com/repos/katsu105/chat-space/issues/events{/number}","events_url":"https://api.github.com/repos/katsu105/chat-space/events","assignees_url":"https://api.github.com/repos/katsu105/chat-space/assignees{/user}","branches_url":"https://api.github.com/repos/katsu105/chat-space/branches{/branch}","tags_url":"https://api.github.com/repos/katsu105/chat-space/tags","blobs_url":"https://api.github.com/repos/katsu105/chat-space/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/katsu105/chat-space/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/katsu105/chat-space/git/refs{/sha}","trees_url":"https://api.github.com/repos/katsu105/chat-space/git/trees{/sha}","statuses_url":"https://api.github.com/repos/katsu105/chat-space/statuses/{sha}","languages_url":"https://api.github.com/repos/katsu105/chat-space/languages","stargazers_url":"https://api.github.com/repos/katsu105/chat-space/stargazers","contributors_url":"https://api.github.com/repos/katsu105/chat-space/contributors","subscribers_url":"https://api.github.com/repos/katsu105/chat-space/subscribers","subscription_url":"https://api.github.com/repos/katsu105/chat-space/subscription","commits_url":"https://api.github.com/repos/katsu105/chat-space/commits{/sha}","git_commits_url":"https://api.github.com/repos/katsu105/chat-space/git/commits{/sha}","comments_url":"https://api.github.com/repos/katsu105/chat-space/comments{/number}","issue_comment_url":"https://api.github.com/repos/katsu105/chat-space/issues/comments{/number}","contents_url":"https://api.github.com/repos/katsu105/chat-space/contents/{+path}","compare_url":"https://api.github.com/repos/katsu105/chat-space/compare/{base}...{head}","merges_url":"https://api.github.com/repos/katsu105/chat-space/merges","archive_url":"https://api.github.com/repos/katsu105/chat-space/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/katsu105/chat-space/downloads","issues_url":"https://api.github.com/repos/katsu105/chat-space/issues{/number}","pulls_url":"https://api.github.com/repos/katsu105/chat-space/pulls{/number}","milestones_url":"https://api.github.com/repos/katsu105/chat-space/milestones{/number}","notifications_url":"https://api.github.com/repos/katsu105/chat-space/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/katsu105/chat-space/labels{/name}","releases_url":"https://api.github.com/repos/katsu105/chat-space/releases{/id}","deployments_url":"https://api.github.com/repos/katsu105/chat-space/deployments","created_at":"2018-10-01T08:31:09Z","updated_at":"2018-11-08T02:02:21Z","pushed_at":"2018-11-08T09:47:26Z","git_url":"git://github.com/katsu105/chat-space.git","ssh_url":"git@github.com:katsu105/chat-space.git","clone_url":"https://github.com/katsu105/chat-space.git","svn_url":"https://github.com/katsu105/chat-space","homepage":null,"size":301,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/katsu105/chat-space/pulls/16"},"html":{"href":"https://github.com/katsu105/chat-space/pull/16"},"issue":{"href":"https://api.github.com/repos/katsu105/chat-space/issues/16"},"comments":{"href":"https://api.github.com/repos/katsu105/chat-space/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/katsu105/chat-space/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/katsu105/chat-space/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/katsu105/chat-space/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/katsu105/chat-space/statuses/a023a40e3ce294b1a521ab4a280dc2195736c582"}},"author_association":"OWNER"}}
{"actor":{"display_login":"kohei-isoda"}}