{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/ecommerce_52/pulls/comments/213555405","pull_request_review_id":150413825,"id":213555405,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMzU1NTQwNQ==","diff_hunk":"@@ -0,0 +1,38 @@\n+module SessionsHelper\n+  def log_in user\n+    session[:user_id] = user.id\n+  end\n+\n+  def remember user\n+    user.remember\n+    cookies.permanent.signed[:user_id] = user.id\n+    cookies.permanent[:remember_token] = user.remember_token\n+  end\n+\n+  def forget user\n+    user.forget\n+    cookies.delete(:user_id)\n+    cookies.delete(:remember_token)\n+  end\n+\n+  def current_user\n+    if user_id = session[:user_id]\n+      @current_user ||= User.find_by(id: user_id)\n+    elsif (user_id = cookies.signed[:user_id])\n+      user = User.find_by(id: user_id)\n+      if user&.authenticated?(:remember, cookies[:remember_token])\n+        log_in user\n+        @current_user = user\n+      end\n+    end\n+  end\n+\n+  def logged_in?\n+    current_user.present?\n+  end\n+\n+  def log_out\n+    session.delete(:user_id)","path":"app/helpers/sessions_helper.rb","position":35,"original_position":35,"commit_id":"82d5f4df4e708bf3864a6c0e24666c76562ad526","original_commit_id":"82d5f4df4e708bf3864a6c0e24666c76562ad526","user":{"login":"VuThiTranVan","id":27009821,"node_id":"MDQ6VXNlcjI3MDA5ODIx","avatar_url":"https://avatars3.githubusercontent.com/u/27009821?v=4","gravatar_id":"","url":"https://api.github.com/users/VuThiTranVan","html_url":"https://github.com/VuThiTranVan","followers_url":"https://api.github.com/users/VuThiTranVan/followers","following_url":"https://api.github.com/users/VuThiTranVan/following{/other_user}","gists_url":"https://api.github.com/users/VuThiTranVan/gists{/gist_id}","starred_url":"https://api.github.com/users/VuThiTranVan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VuThiTranVan/subscriptions","organizations_url":"https://api.github.com/users/VuThiTranVan/orgs","repos_url":"https://api.github.com/users/VuThiTranVan/repos","events_url":"https://api.github.com/users/VuThiTranVan/events{/privacy}","received_events_url":"https://api.github.com/users/VuThiTranVan/received_events","type":"User","site_admin":false},"body":"bỏ ngoặc thanh niên","created_at":"2018-08-29T06:13:27Z","updated_at":"2018-08-29T06:14:39Z","html_url":"https://github.com/framgia/ecommerce_52/pull/7#discussion_r213555405","pull_request_url":"https://api.github.com/repos/framgia/ecommerce_52/pulls/7","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/framgia/ecommerce_52/pulls/comments/213555405"},"html":{"href":"https://github.com/framgia/ecommerce_52/pull/7#discussion_r213555405"},"pull_request":{"href":"https://api.github.com/repos/framgia/ecommerce_52/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/ecommerce_52/pulls/7","id":211599751,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExNTk5NzUx","html_url":"https://github.com/framgia/ecommerce_52/pull/7","diff_url":"https://github.com/framgia/ecommerce_52/pull/7.diff","patch_url":"https://github.com/framgia/ecommerce_52/pull/7.patch","issue_url":"https://api.github.com/repos/framgia/ecommerce_52/issues/7","number":7,"state":"open","locked":false,"title":"Login_Logout","user":{"login":"duongtruong9294","id":41627109,"node_id":"MDQ6VXNlcjQxNjI3MTA5","avatar_url":"https://avatars2.githubusercontent.com/u/41627109?v=4","gravatar_id":"","url":"https://api.github.com/users/duongtruong9294","html_url":"https://github.com/duongtruong9294","followers_url":"https://api.github.com/users/duongtruong9294/followers","following_url":"https://api.github.com/users/duongtruong9294/following{/other_user}","gists_url":"https://api.github.com/users/duongtruong9294/gists{/gist_id}","starred_url":"https://api.github.com/users/duongtruong9294/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duongtruong9294/subscriptions","organizations_url":"https://api.github.com/users/duongtruong9294/orgs","repos_url":"https://api.github.com/users/duongtruong9294/repos","events_url":"https://api.github.com/users/duongtruong9294/events{/privacy}","received_events_url":"https://api.github.com/users/duongtruong9294/received_events","type":"User","site_admin":false},"body":"![login_logout](https://user-images.githubusercontent.com/41627109/44759051-0c853000-ab62-11e8-8bdd-34b06e8f88d2.png)\r\n","created_at":"2018-08-29T01:03:50Z","updated_at":"2018-08-29T06:14:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"caab17583a66b9d0bc48d9a499ff91ab23291efe","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/ecommerce_52/pulls/7/commits","review_comments_url":"https://api.github.com/repos/framgia/ecommerce_52/pulls/7/comments","review_comment_url":"https://api.github.com/repos/framgia/ecommerce_52/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/ecommerce_52/issues/7/comments","statuses_url":"https://api.github.com/repos/framgia/ecommerce_52/statuses/82d5f4df4e708bf3864a6c0e24666c76562ad526","head":{"label":"duongtruong9294:admin_login","ref":"admin_login","sha":"82d5f4df4e708bf3864a6c0e24666c76562ad526","user":{"login":"duongtruong9294","id":41627109,"node_id":"MDQ6VXNlcjQxNjI3MTA5","avatar_url":"https://avatars2.githubusercontent.com/u/41627109?v=4","gravatar_id":"","url":"https://api.github.com/users/duongtruong9294","html_url":"https://github.com/duongtruong9294","followers_url":"https://api.github.com/users/duongtruong9294/followers","following_url":"https://api.github.com/users/duongtruong9294/following{/other_user}","gists_url":"https://api.github.com/users/duongtruong9294/gists{/gist_id}","starred_url":"https://api.github.com/users/duongtruong9294/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duongtruong9294/subscriptions","organizations_url":"https://api.github.com/users/duongtruong9294/orgs","repos_url":"https://api.github.com/users/duongtruong9294/repos","events_url":"https://api.github.com/users/duongtruong9294/events{/privacy}","received_events_url":"https://api.github.com/users/duongtruong9294/received_events","type":"User","site_admin":false},"repo":{"id":146083850,"node_id":"MDEwOlJlcG9zaXRvcnkxNDYwODM4NTA=","name":"ecommerce_52","full_name":"duongtruong9294/ecommerce_52","owner":{"login":"duongtruong9294","id":41627109,"node_id":"MDQ6VXNlcjQxNjI3MTA5","avatar_url":"https://avatars2.githubusercontent.com/u/41627109?v=4","gravatar_id":"","url":"https://api.github.com/users/duongtruong9294","html_url":"https://github.com/duongtruong9294","followers_url":"https://api.github.com/users/duongtruong9294/followers","following_url":"https://api.github.com/users/duongtruong9294/following{/other_user}","gists_url":"https://api.github.com/users/duongtruong9294/gists{/gist_id}","starred_url":"https://api.github.com/users/duongtruong9294/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duongtruong9294/subscriptions","organizations_url":"https://api.github.com/users/duongtruong9294/orgs","repos_url":"https://api.github.com/users/duongtruong9294/repos","events_url":"https://api.github.com/users/duongtruong9294/events{/privacy}","received_events_url":"https://api.github.com/users/duongtruong9294/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/duongtruong9294/ecommerce_52","description":null,"fork":true,"url":"https://api.github.com/repos/duongtruong9294/ecommerce_52","forks_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/forks","keys_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/teams","hooks_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/hooks","issue_events_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/issues/events{/number}","events_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/events","assignees_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/assignees{/user}","branches_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/branches{/branch}","tags_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/tags","blobs_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/git/refs{/sha}","trees_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/statuses/{sha}","languages_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/languages","stargazers_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/stargazers","contributors_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/contributors","subscribers_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/subscribers","subscription_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/subscription","commits_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/commits{/sha}","git_commits_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/git/commits{/sha}","comments_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/comments{/number}","issue_comment_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/issues/comments{/number}","contents_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/contents/{+path}","compare_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/merges","archive_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/downloads","issues_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/issues{/number}","pulls_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/pulls{/number}","milestones_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/milestones{/number}","notifications_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/labels{/name}","releases_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/releases{/id}","deployments_url":"https://api.github.com/repos/duongtruong9294/ecommerce_52/deployments","created_at":"2018-08-25T09:46:11Z","updated_at":"2018-08-25T09:46:12Z","pushed_at":"2018-08-29T06:07:14Z","git_url":"git://github.com/duongtruong9294/ecommerce_52.git","ssh_url":"git@github.com:duongtruong9294/ecommerce_52.git","clone_url":"https://github.com/duongtruong9294/ecommerce_52.git","svn_url":"https://github.com/duongtruong9294/ecommerce_52","homepage":null,"size":118,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"framgia:develop","ref":"develop","sha":"b190dc9cf5f29ad08ccb7a4415c8959c2743077f","user":{"login":"framgia","id":2322183,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMjIxODM=","avatar_url":"https://avatars3.githubusercontent.com/u/2322183?v=4","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":146080364,"node_id":"MDEwOlJlcG9zaXRvcnkxNDYwODAzNjQ=","name":"ecommerce_52","full_name":"framgia/ecommerce_52","owner":{"login":"framgia","id":2322183,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMjIxODM=","avatar_url":"https://avatars3.githubusercontent.com/u/2322183?v=4","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/ecommerce_52","description":null,"fork":false,"url":"https://api.github.com/repos/framgia/ecommerce_52","forks_url":"https://api.github.com/repos/framgia/ecommerce_52/forks","keys_url":"https://api.github.com/repos/framgia/ecommerce_52/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/ecommerce_52/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/ecommerce_52/teams","hooks_url":"https://api.github.com/repos/framgia/ecommerce_52/hooks","issue_events_url":"https://api.github.com/repos/framgia/ecommerce_52/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/ecommerce_52/events","assignees_url":"https://api.github.com/repos/framgia/ecommerce_52/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/ecommerce_52/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/ecommerce_52/tags","blobs_url":"https://api.github.com/repos/framgia/ecommerce_52/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/ecommerce_52/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/ecommerce_52/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/ecommerce_52/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/ecommerce_52/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/ecommerce_52/languages","stargazers_url":"https://api.github.com/repos/framgia/ecommerce_52/stargazers","contributors_url":"https://api.github.com/repos/framgia/ecommerce_52/contributors","subscribers_url":"https://api.github.com/repos/framgia/ecommerce_52/subscribers","subscription_url":"https://api.github.com/repos/framgia/ecommerce_52/subscription","commits_url":"https://api.github.com/repos/framgia/ecommerce_52/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/ecommerce_52/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/ecommerce_52/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/ecommerce_52/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/ecommerce_52/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/ecommerce_52/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/ecommerce_52/merges","archive_url":"https://api.github.com/repos/framgia/ecommerce_52/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/ecommerce_52/downloads","issues_url":"https://api.github.com/repos/framgia/ecommerce_52/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/ecommerce_52/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/ecommerce_52/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/ecommerce_52/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/ecommerce_52/labels{/name}","releases_url":"https://api.github.com/repos/framgia/ecommerce_52/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/ecommerce_52/deployments","created_at":"2018-08-25T08:48:17Z","updated_at":"2018-08-29T06:02:17Z","pushed_at":"2018-08-29T06:07:45Z","git_url":"git://github.com/framgia/ecommerce_52.git","ssh_url":"git@github.com:framgia/ecommerce_52.git","clone_url":"https://github.com/framgia/ecommerce_52.git","svn_url":"https://github.com/framgia/ecommerce_52","homepage":null,"size":52,"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":3,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":3,"open_issues":5,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/ecommerce_52/pulls/7"},"html":{"href":"https://github.com/framgia/ecommerce_52/pull/7"},"issue":{"href":"https://api.github.com/repos/framgia/ecommerce_52/issues/7"},"comments":{"href":"https://api.github.com/repos/framgia/ecommerce_52/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/ecommerce_52/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/ecommerce_52/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/ecommerce_52/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/ecommerce_52/statuses/82d5f4df4e708bf3864a6c0e24666c76562ad526"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"VuThiTranVan"}}