{"action":"created","comment":{"url":"https://api.github.com/repos/koutaodawara/protospace/pulls/comments/65066571","id":65066571,"diff_hunk":"@@ -0,0 +1,22 @@\n+class LikesController < ApplicationController\n+   before_action :product_find, only: [:create, :destroy]\n+\n+  def create\n+    @like = current_user.likes.create(argument)\n+  end\n+\n+  def destroy\n+    @like = current_user.likes.find_by(argument)\n+    @like.destroy\n+  end\n+\n+\n+private\n+  def argument","path":"app/controllers/likes_controller.rb","position":15,"original_position":15,"commit_id":"fba8c13f3f0a34f3cf10f48fb169b0deb0fc2e03","original_commit_id":"fba8c13f3f0a34f3cf10f48fb169b0deb0fc2e03","user":{"login":"koutaodawara","id":16679894,"avatar_url":"https://avatars.githubusercontent.com/u/16679894?v=3","gravatar_id":"","url":"https://api.github.com/users/koutaodawara","html_url":"https://github.com/koutaodawara","followers_url":"https://api.github.com/users/koutaodawara/followers","following_url":"https://api.github.com/users/koutaodawara/following{/other_user}","gists_url":"https://api.github.com/users/koutaodawara/gists{/gist_id}","starred_url":"https://api.github.com/users/koutaodawara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koutaodawara/subscriptions","organizations_url":"https://api.github.com/users/koutaodawara/orgs","repos_url":"https://api.github.com/users/koutaodawara/repos","events_url":"https://api.github.com/users/koutaodawara/events{/privacy}","received_events_url":"https://api.github.com/users/koutaodawara/received_events","type":"User","site_admin":false},"body":"了解です！","created_at":"2016-05-30T12:42:02Z","updated_at":"2016-05-30T12:42:02Z","html_url":"https://github.com/koutaodawara/protospace/pull/12#discussion_r65066571","pull_request_url":"https://api.github.com/repos/koutaodawara/protospace/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/koutaodawara/protospace/pulls/comments/65066571"},"html":{"href":"https://github.com/koutaodawara/protospace/pull/12#discussion_r65066571"},"pull_request":{"href":"https://api.github.com/repos/koutaodawara/protospace/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/koutaodawara/protospace/pulls/12","id":70977158,"html_url":"https://github.com/koutaodawara/protospace/pull/12","diff_url":"https://github.com/koutaodawara/protospace/pull/12.diff","patch_url":"https://github.com/koutaodawara/protospace/pull/12.patch","issue_url":"https://api.github.com/repos/koutaodawara/protospace/issues/12","number":12,"state":"open","locked":false,"title":"{WIP}like機能の追加","user":{"login":"koutaodawara","id":16679894,"avatar_url":"https://avatars.githubusercontent.com/u/16679894?v=3","gravatar_id":"","url":"https://api.github.com/users/koutaodawara","html_url":"https://github.com/koutaodawara","followers_url":"https://api.github.com/users/koutaodawara/followers","following_url":"https://api.github.com/users/koutaodawara/following{/other_user}","gists_url":"https://api.github.com/users/koutaodawara/gists{/gist_id}","starred_url":"https://api.github.com/users/koutaodawara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koutaodawara/subscriptions","organizations_url":"https://api.github.com/users/koutaodawara/orgs","repos_url":"https://api.github.com/users/koutaodawara/repos","events_url":"https://api.github.com/users/koutaodawara/events{/privacy}","received_events_url":"https://api.github.com/users/koutaodawara/received_events","type":"User","site_admin":false},"body":"# what\r\n* likeテーブルを作る\r\n* ajaxを用いてlike機能の実装\r\n* counter_cacheを使ってこモデルの数を親モデルが保持する\r\n\r\n# why\r\n* 子モデルを作るため\r\n* likeのボタンを押したら画面の遷移なしでハートをつけたり消したりできるように\r\n* 子モデルのつまり、ハートが押された回数を表すため\r\n","created_at":"2016-05-22T13:32:47Z","updated_at":"2016-05-30T12:42:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3069a948eb0f39e98bb06cbe974cf536c037af88","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/koutaodawara/protospace/pulls/12/commits","review_comments_url":"https://api.github.com/repos/koutaodawara/protospace/pulls/12/comments","review_comment_url":"https://api.github.com/repos/koutaodawara/protospace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/koutaodawara/protospace/issues/12/comments","statuses_url":"https://api.github.com/repos/koutaodawara/protospace/statuses/fba8c13f3f0a34f3cf10f48fb169b0deb0fc2e03","head":{"label":"koutaodawara:like機能","ref":"like機能","sha":"fba8c13f3f0a34f3cf10f48fb169b0deb0fc2e03","user":{"login":"koutaodawara","id":16679894,"avatar_url":"https://avatars.githubusercontent.com/u/16679894?v=3","gravatar_id":"","url":"https://api.github.com/users/koutaodawara","html_url":"https://github.com/koutaodawara","followers_url":"https://api.github.com/users/koutaodawara/followers","following_url":"https://api.github.com/users/koutaodawara/following{/other_user}","gists_url":"https://api.github.com/users/koutaodawara/gists{/gist_id}","starred_url":"https://api.github.com/users/koutaodawara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koutaodawara/subscriptions","organizations_url":"https://api.github.com/users/koutaodawara/orgs","repos_url":"https://api.github.com/users/koutaodawara/repos","events_url":"https://api.github.com/users/koutaodawara/events{/privacy}","received_events_url":"https://api.github.com/users/koutaodawara/received_events","type":"User","site_admin":false},"repo":{"id":54451623,"name":"protospace","full_name":"koutaodawara/protospace","owner":{"login":"koutaodawara","id":16679894,"avatar_url":"https://avatars.githubusercontent.com/u/16679894?v=3","gravatar_id":"","url":"https://api.github.com/users/koutaodawara","html_url":"https://github.com/koutaodawara","followers_url":"https://api.github.com/users/koutaodawara/followers","following_url":"https://api.github.com/users/koutaodawara/following{/other_user}","gists_url":"https://api.github.com/users/koutaodawara/gists{/gist_id}","starred_url":"https://api.github.com/users/koutaodawara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koutaodawara/subscriptions","organizations_url":"https://api.github.com/users/koutaodawara/orgs","repos_url":"https://api.github.com/users/koutaodawara/repos","events_url":"https://api.github.com/users/koutaodawara/events{/privacy}","received_events_url":"https://api.github.com/users/koutaodawara/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/koutaodawara/protospace","description":"","fork":false,"url":"https://api.github.com/repos/koutaodawara/protospace","forks_url":"https://api.github.com/repos/koutaodawara/protospace/forks","keys_url":"https://api.github.com/repos/koutaodawara/protospace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/koutaodawara/protospace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/koutaodawara/protospace/teams","hooks_url":"https://api.github.com/repos/koutaodawara/protospace/hooks","issue_events_url":"https://api.github.com/repos/koutaodawara/protospace/issues/events{/number}","events_url":"https://api.github.com/repos/koutaodawara/protospace/events","assignees_url":"https://api.github.com/repos/koutaodawara/protospace/assignees{/user}","branches_url":"https://api.github.com/repos/koutaodawara/protospace/branches{/branch}","tags_url":"https://api.github.com/repos/koutaodawara/protospace/tags","blobs_url":"https://api.github.com/repos/koutaodawara/protospace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/koutaodawara/protospace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/koutaodawara/protospace/git/refs{/sha}","trees_url":"https://api.github.com/repos/koutaodawara/protospace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/koutaodawara/protospace/statuses/{sha}","languages_url":"https://api.github.com/repos/koutaodawara/protospace/languages","stargazers_url":"https://api.github.com/repos/koutaodawara/protospace/stargazers","contributors_url":"https://api.github.com/repos/koutaodawara/protospace/contributors","subscribers_url":"https://api.github.com/repos/koutaodawara/protospace/subscribers","subscription_url":"https://api.github.com/repos/koutaodawara/protospace/subscription","commits_url":"https://api.github.com/repos/koutaodawara/protospace/commits{/sha}","git_commits_url":"https://api.github.com/repos/koutaodawara/protospace/git/commits{/sha}","comments_url":"https://api.github.com/repos/koutaodawara/protospace/comments{/number}","issue_comment_url":"https://api.github.com/repos/koutaodawara/protospace/issues/comments{/number}","contents_url":"https://api.github.com/repos/koutaodawara/protospace/contents/{+path}","compare_url":"https://api.github.com/repos/koutaodawara/protospace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/koutaodawara/protospace/merges","archive_url":"https://api.github.com/repos/koutaodawara/protospace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/koutaodawara/protospace/downloads","issues_url":"https://api.github.com/repos/koutaodawara/protospace/issues{/number}","pulls_url":"https://api.github.com/repos/koutaodawara/protospace/pulls{/number}","milestones_url":"https://api.github.com/repos/koutaodawara/protospace/milestones{/number}","notifications_url":"https://api.github.com/repos/koutaodawara/protospace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/koutaodawara/protospace/labels{/name}","releases_url":"https://api.github.com/repos/koutaodawara/protospace/releases{/id}","deployments_url":"https://api.github.com/repos/koutaodawara/protospace/deployments","created_at":"2016-03-22T06:41:55Z","updated_at":"2016-03-22T06:45:11Z","pushed_at":"2016-05-30T12:16:27Z","git_url":"git://github.com/koutaodawara/protospace.git","ssh_url":"git@github.com:koutaodawara/protospace.git","clone_url":"https://github.com/koutaodawara/protospace.git","svn_url":"https://github.com/koutaodawara/protospace","homepage":"","size":709,"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":"koutaodawara:master","ref":"master","sha":"fdd9c347eb04fcb7b82421655bf9645f2465961f","user":{"login":"koutaodawara","id":16679894,"avatar_url":"https://avatars.githubusercontent.com/u/16679894?v=3","gravatar_id":"","url":"https://api.github.com/users/koutaodawara","html_url":"https://github.com/koutaodawara","followers_url":"https://api.github.com/users/koutaodawara/followers","following_url":"https://api.github.com/users/koutaodawara/following{/other_user}","gists_url":"https://api.github.com/users/koutaodawara/gists{/gist_id}","starred_url":"https://api.github.com/users/koutaodawara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koutaodawara/subscriptions","organizations_url":"https://api.github.com/users/koutaodawara/orgs","repos_url":"https://api.github.com/users/koutaodawara/repos","events_url":"https://api.github.com/users/koutaodawara/events{/privacy}","received_events_url":"https://api.github.com/users/koutaodawara/received_events","type":"User","site_admin":false},"repo":{"id":54451623,"name":"protospace","full_name":"koutaodawara/protospace","owner":{"login":"koutaodawara","id":16679894,"avatar_url":"https://avatars.githubusercontent.com/u/16679894?v=3","gravatar_id":"","url":"https://api.github.com/users/koutaodawara","html_url":"https://github.com/koutaodawara","followers_url":"https://api.github.com/users/koutaodawara/followers","following_url":"https://api.github.com/users/koutaodawara/following{/other_user}","gists_url":"https://api.github.com/users/koutaodawara/gists{/gist_id}","starred_url":"https://api.github.com/users/koutaodawara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koutaodawara/subscriptions","organizations_url":"https://api.github.com/users/koutaodawara/orgs","repos_url":"https://api.github.com/users/koutaodawara/repos","events_url":"https://api.github.com/users/koutaodawara/events{/privacy}","received_events_url":"https://api.github.com/users/koutaodawara/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/koutaodawara/protospace","description":"","fork":false,"url":"https://api.github.com/repos/koutaodawara/protospace","forks_url":"https://api.github.com/repos/koutaodawara/protospace/forks","keys_url":"https://api.github.com/repos/koutaodawara/protospace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/koutaodawara/protospace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/koutaodawara/protospace/teams","hooks_url":"https://api.github.com/repos/koutaodawara/protospace/hooks","issue_events_url":"https://api.github.com/repos/koutaodawara/protospace/issues/events{/number}","events_url":"https://api.github.com/repos/koutaodawara/protospace/events","assignees_url":"https://api.github.com/repos/koutaodawara/protospace/assignees{/user}","branches_url":"https://api.github.com/repos/koutaodawara/protospace/branches{/branch}","tags_url":"https://api.github.com/repos/koutaodawara/protospace/tags","blobs_url":"https://api.github.com/repos/koutaodawara/protospace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/koutaodawara/protospace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/koutaodawara/protospace/git/refs{/sha}","trees_url":"https://api.github.com/repos/koutaodawara/protospace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/koutaodawara/protospace/statuses/{sha}","languages_url":"https://api.github.com/repos/koutaodawara/protospace/languages","stargazers_url":"https://api.github.com/repos/koutaodawara/protospace/stargazers","contributors_url":"https://api.github.com/repos/koutaodawara/protospace/contributors","subscribers_url":"https://api.github.com/repos/koutaodawara/protospace/subscribers","subscription_url":"https://api.github.com/repos/koutaodawara/protospace/subscription","commits_url":"https://api.github.com/repos/koutaodawara/protospace/commits{/sha}","git_commits_url":"https://api.github.com/repos/koutaodawara/protospace/git/commits{/sha}","comments_url":"https://api.github.com/repos/koutaodawara/protospace/comments{/number}","issue_comment_url":"https://api.github.com/repos/koutaodawara/protospace/issues/comments{/number}","contents_url":"https://api.github.com/repos/koutaodawara/protospace/contents/{+path}","compare_url":"https://api.github.com/repos/koutaodawara/protospace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/koutaodawara/protospace/merges","archive_url":"https://api.github.com/repos/koutaodawara/protospace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/koutaodawara/protospace/downloads","issues_url":"https://api.github.com/repos/koutaodawara/protospace/issues{/number}","pulls_url":"https://api.github.com/repos/koutaodawara/protospace/pulls{/number}","milestones_url":"https://api.github.com/repos/koutaodawara/protospace/milestones{/number}","notifications_url":"https://api.github.com/repos/koutaodawara/protospace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/koutaodawara/protospace/labels{/name}","releases_url":"https://api.github.com/repos/koutaodawara/protospace/releases{/id}","deployments_url":"https://api.github.com/repos/koutaodawara/protospace/deployments","created_at":"2016-03-22T06:41:55Z","updated_at":"2016-03-22T06:45:11Z","pushed_at":"2016-05-30T12:16:27Z","git_url":"git://github.com/koutaodawara/protospace.git","ssh_url":"git@github.com:koutaodawara/protospace.git","clone_url":"https://github.com/koutaodawara/protospace.git","svn_url":"https://github.com/koutaodawara/protospace","homepage":"","size":709,"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/koutaodawara/protospace/pulls/12"},"html":{"href":"https://github.com/koutaodawara/protospace/pull/12"},"issue":{"href":"https://api.github.com/repos/koutaodawara/protospace/issues/12"},"comments":{"href":"https://api.github.com/repos/koutaodawara/protospace/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/koutaodawara/protospace/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/koutaodawara/protospace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/koutaodawara/protospace/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/koutaodawara/protospace/statuses/fba8c13f3f0a34f3cf10f48fb169b0deb0fc2e03"}}}}
{"actor":{"display_login":"koutaodawara"}}