{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/brs_42/pulls/comments/92740665","pull_request_review_id":13261667,"id":92740665,"diff_hunk":"@@ -0,0 +1,27 @@\n+class LikesController < ApplicationController\n+  before_action :logged_in_user, only: [:create, :destroy]\n+\n+  def create\n+    @like = current_user.likes.build review_id: params[:review_id]\n+    if @like.save\n+      respond_to do |format|\n+        format.js\n+      end\n+    else\n+      flash[:danger] = @like.errors.full_messages\n+      redirect_to book_path @like.review.book\n+    end \n+  end\n+\n+  def destroy\n+    @like = current_user.likes.find_by id: params[:id]","path":"app/controllers/likes_controller.rb","position":17,"original_position":17,"commit_id":"81caa649809ec034bf478f85a4e608d51503c07c","original_commit_id":"a55617552e7b0c1ef21d83cb5160cc9df00ab576","user":{"login":"dothidiemthao","id":21377118,"avatar_url":"https://avatars.githubusercontent.com/u/21377118?v=3","gravatar_id":"","url":"https://api.github.com/users/dothidiemthao","html_url":"https://github.com/dothidiemthao","followers_url":"https://api.github.com/users/dothidiemthao/followers","following_url":"https://api.github.com/users/dothidiemthao/following{/other_user}","gists_url":"https://api.github.com/users/dothidiemthao/gists{/gist_id}","starred_url":"https://api.github.com/users/dothidiemthao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dothidiemthao/subscriptions","organizations_url":"https://api.github.com/users/dothidiemthao/orgs","repos_url":"https://api.github.com/users/dothidiemthao/repos","events_url":"https://api.github.com/users/dothidiemthao/events{/privacy}","received_events_url":"https://api.github.com/users/dothidiemthao/received_events","type":"User","site_admin":false},"body":"tách nó ra method khác nhìn cho gọn e","created_at":"2016-12-16T02:21:18Z","updated_at":"2016-12-16T02:25:24Z","html_url":"https://github.com/framgia/brs_42/pull/25#discussion_r92740665","pull_request_url":"https://api.github.com/repos/framgia/brs_42/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/framgia/brs_42/pulls/comments/92740665"},"html":{"href":"https://github.com/framgia/brs_42/pull/25#discussion_r92740665"},"pull_request":{"href":"https://api.github.com/repos/framgia/brs_42/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/brs_42/pulls/25","id":98106836,"html_url":"https://github.com/framgia/brs_42/pull/25","diff_url":"https://github.com/framgia/brs_42/pull/25.diff","patch_url":"https://github.com/framgia/brs_42/pull/25.patch","issue_url":"https://api.github.com/repos/framgia/brs_42/issues/25","number":25,"state":"open","locked":false,"title":"Like review","user":{"login":"lequangcanh","id":19974244,"avatar_url":"https://avatars.githubusercontent.com/u/19974244?v=3","gravatar_id":"","url":"https://api.github.com/users/lequangcanh","html_url":"https://github.com/lequangcanh","followers_url":"https://api.github.com/users/lequangcanh/followers","following_url":"https://api.github.com/users/lequangcanh/following{/other_user}","gists_url":"https://api.github.com/users/lequangcanh/gists{/gist_id}","starred_url":"https://api.github.com/users/lequangcanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lequangcanh/subscriptions","organizations_url":"https://api.github.com/users/lequangcanh/orgs","repos_url":"https://api.github.com/users/lequangcanh/repos","events_url":"https://api.github.com/users/lequangcanh/events{/privacy}","received_events_url":"https://api.github.com/users/lequangcanh/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-15T08:35:48Z","updated_at":"2016-12-16T02:25:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ecd4ffd17eb68ff7c4d8e505bd474096e195b4fc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/brs_42/pulls/25/commits","review_comments_url":"https://api.github.com/repos/framgia/brs_42/pulls/25/comments","review_comment_url":"https://api.github.com/repos/framgia/brs_42/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/brs_42/issues/25/comments","statuses_url":"https://api.github.com/repos/framgia/brs_42/statuses/81caa649809ec034bf478f85a4e608d51503c07c","head":{"label":"lequangcanh:like-review","ref":"like-review","sha":"81caa649809ec034bf478f85a4e608d51503c07c","user":{"login":"lequangcanh","id":19974244,"avatar_url":"https://avatars.githubusercontent.com/u/19974244?v=3","gravatar_id":"","url":"https://api.github.com/users/lequangcanh","html_url":"https://github.com/lequangcanh","followers_url":"https://api.github.com/users/lequangcanh/followers","following_url":"https://api.github.com/users/lequangcanh/following{/other_user}","gists_url":"https://api.github.com/users/lequangcanh/gists{/gist_id}","starred_url":"https://api.github.com/users/lequangcanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lequangcanh/subscriptions","organizations_url":"https://api.github.com/users/lequangcanh/orgs","repos_url":"https://api.github.com/users/lequangcanh/repos","events_url":"https://api.github.com/users/lequangcanh/events{/privacy}","received_events_url":"https://api.github.com/users/lequangcanh/received_events","type":"User","site_admin":false},"repo":{"id":75275012,"name":"brs_42","full_name":"lequangcanh/brs_42","owner":{"login":"lequangcanh","id":19974244,"avatar_url":"https://avatars.githubusercontent.com/u/19974244?v=3","gravatar_id":"","url":"https://api.github.com/users/lequangcanh","html_url":"https://github.com/lequangcanh","followers_url":"https://api.github.com/users/lequangcanh/followers","following_url":"https://api.github.com/users/lequangcanh/following{/other_user}","gists_url":"https://api.github.com/users/lequangcanh/gists{/gist_id}","starred_url":"https://api.github.com/users/lequangcanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lequangcanh/subscriptions","organizations_url":"https://api.github.com/users/lequangcanh/orgs","repos_url":"https://api.github.com/users/lequangcanh/repos","events_url":"https://api.github.com/users/lequangcanh/events{/privacy}","received_events_url":"https://api.github.com/users/lequangcanh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lequangcanh/brs_42","description":null,"fork":true,"url":"https://api.github.com/repos/lequangcanh/brs_42","forks_url":"https://api.github.com/repos/lequangcanh/brs_42/forks","keys_url":"https://api.github.com/repos/lequangcanh/brs_42/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lequangcanh/brs_42/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lequangcanh/brs_42/teams","hooks_url":"https://api.github.com/repos/lequangcanh/brs_42/hooks","issue_events_url":"https://api.github.com/repos/lequangcanh/brs_42/issues/events{/number}","events_url":"https://api.github.com/repos/lequangcanh/brs_42/events","assignees_url":"https://api.github.com/repos/lequangcanh/brs_42/assignees{/user}","branches_url":"https://api.github.com/repos/lequangcanh/brs_42/branches{/branch}","tags_url":"https://api.github.com/repos/lequangcanh/brs_42/tags","blobs_url":"https://api.github.com/repos/lequangcanh/brs_42/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lequangcanh/brs_42/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lequangcanh/brs_42/git/refs{/sha}","trees_url":"https://api.github.com/repos/lequangcanh/brs_42/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lequangcanh/brs_42/statuses/{sha}","languages_url":"https://api.github.com/repos/lequangcanh/brs_42/languages","stargazers_url":"https://api.github.com/repos/lequangcanh/brs_42/stargazers","contributors_url":"https://api.github.com/repos/lequangcanh/brs_42/contributors","subscribers_url":"https://api.github.com/repos/lequangcanh/brs_42/subscribers","subscription_url":"https://api.github.com/repos/lequangcanh/brs_42/subscription","commits_url":"https://api.github.com/repos/lequangcanh/brs_42/commits{/sha}","git_commits_url":"https://api.github.com/repos/lequangcanh/brs_42/git/commits{/sha}","comments_url":"https://api.github.com/repos/lequangcanh/brs_42/comments{/number}","issue_comment_url":"https://api.github.com/repos/lequangcanh/brs_42/issues/comments{/number}","contents_url":"https://api.github.com/repos/lequangcanh/brs_42/contents/{+path}","compare_url":"https://api.github.com/repos/lequangcanh/brs_42/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lequangcanh/brs_42/merges","archive_url":"https://api.github.com/repos/lequangcanh/brs_42/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lequangcanh/brs_42/downloads","issues_url":"https://api.github.com/repos/lequangcanh/brs_42/issues{/number}","pulls_url":"https://api.github.com/repos/lequangcanh/brs_42/pulls{/number}","milestones_url":"https://api.github.com/repos/lequangcanh/brs_42/milestones{/number}","notifications_url":"https://api.github.com/repos/lequangcanh/brs_42/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lequangcanh/brs_42/labels{/name}","releases_url":"https://api.github.com/repos/lequangcanh/brs_42/releases{/id}","deployments_url":"https://api.github.com/repos/lequangcanh/brs_42/deployments","created_at":"2016-12-01T09:09:56Z","updated_at":"2016-12-05T08:55:10Z","pushed_at":"2016-12-16T02:19:52Z","git_url":"git://github.com/lequangcanh/brs_42.git","ssh_url":"git@github.com:lequangcanh/brs_42.git","clone_url":"https://github.com/lequangcanh/brs_42.git","svn_url":"https://github.com/lequangcanh/brs_42","homepage":null,"size":1109,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"framgia:develop","ref":"develop","sha":"fa1082202bacc99c03b8172bac305724eeb58a81","user":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"repo":{"id":75271845,"name":"brs_42","full_name":"framgia/brs_42","owner":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/framgia/brs_42","description":null,"fork":false,"url":"https://api.github.com/repos/framgia/brs_42","forks_url":"https://api.github.com/repos/framgia/brs_42/forks","keys_url":"https://api.github.com/repos/framgia/brs_42/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/brs_42/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/brs_42/teams","hooks_url":"https://api.github.com/repos/framgia/brs_42/hooks","issue_events_url":"https://api.github.com/repos/framgia/brs_42/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/brs_42/events","assignees_url":"https://api.github.com/repos/framgia/brs_42/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/brs_42/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/brs_42/tags","blobs_url":"https://api.github.com/repos/framgia/brs_42/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/brs_42/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/brs_42/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/brs_42/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/brs_42/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/brs_42/languages","stargazers_url":"https://api.github.com/repos/framgia/brs_42/stargazers","contributors_url":"https://api.github.com/repos/framgia/brs_42/contributors","subscribers_url":"https://api.github.com/repos/framgia/brs_42/subscribers","subscription_url":"https://api.github.com/repos/framgia/brs_42/subscription","commits_url":"https://api.github.com/repos/framgia/brs_42/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/brs_42/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/brs_42/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/brs_42/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/brs_42/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/brs_42/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/brs_42/merges","archive_url":"https://api.github.com/repos/framgia/brs_42/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/brs_42/downloads","issues_url":"https://api.github.com/repos/framgia/brs_42/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/brs_42/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/brs_42/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/brs_42/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/brs_42/labels{/name}","releases_url":"https://api.github.com/repos/framgia/brs_42/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/brs_42/deployments","created_at":"2016-12-01T08:30:31Z","updated_at":"2016-12-02T05:04:47Z","pushed_at":"2016-12-16T02:19:52Z","git_url":"git://github.com/framgia/brs_42.git","ssh_url":"git@github.com:framgia/brs_42.git","clone_url":"https://github.com/framgia/brs_42.git","svn_url":"https://github.com/framgia/brs_42","homepage":null,"size":1100,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":5,"forks":3,"open_issues":5,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/brs_42/pulls/25"},"html":{"href":"https://github.com/framgia/brs_42/pull/25"},"issue":{"href":"https://api.github.com/repos/framgia/brs_42/issues/25"},"comments":{"href":"https://api.github.com/repos/framgia/brs_42/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/brs_42/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/brs_42/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/brs_42/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/brs_42/statuses/81caa649809ec034bf478f85a4e608d51503c07c"}}}}
{"actor":{"display_login":"dothidiemthao"}}