{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/brs_37/pulls/comments/81580798","pull_request_review_id":2550130,"id":81580798,"diff_hunk":"@@ -0,0 +1,48 @@\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 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 && 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 forget user\n+    user.forget\n+    cookies.delete(:user_id)\n+    cookies.delete(:remember_token)\n+  end\n+\n+  def log_out\n+    forget(current_user)\n+    session.delete(:user_id)","path":"app/helpers/sessions_helper.rb","position":36,"original_position":36,"commit_id":"b68108dd0d64ac84a257101ad5e14cf4dd345758","original_commit_id":"b68108dd0d64ac84a257101ad5e14cf4dd345758","user":{"login":"dieunb","id":2122175,"avatar_url":"https://avatars.githubusercontent.com/u/2122175?v=3","gravatar_id":"","url":"https://api.github.com/users/dieunb","html_url":"https://github.com/dieunb","followers_url":"https://api.github.com/users/dieunb/followers","following_url":"https://api.github.com/users/dieunb/following{/other_user}","gists_url":"https://api.github.com/users/dieunb/gists{/gist_id}","starred_url":"https://api.github.com/users/dieunb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dieunb/subscriptions","organizations_url":"https://api.github.com/users/dieunb/orgs","repos_url":"https://api.github.com/users/dieunb/repos","events_url":"https://api.github.com/users/dieunb/events{/privacy}","received_events_url":"https://api.github.com/users/dieunb/received_events","type":"User","site_admin":false},"body":"remove `()`","created_at":"2016-10-03T15:58:37Z","updated_at":"2016-10-03T15:58:37Z","html_url":"https://github.com/framgia/brs_37/pull/15#discussion_r81580798","pull_request_url":"https://api.github.com/repos/framgia/brs_37/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/framgia/brs_37/pulls/comments/81580798"},"html":{"href":"https://github.com/framgia/brs_37/pull/15#discussion_r81580798"},"pull_request":{"href":"https://api.github.com/repos/framgia/brs_37/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/brs_37/pulls/15","id":87693843,"html_url":"https://github.com/framgia/brs_37/pull/15","diff_url":"https://github.com/framgia/brs_37/pull/15.diff","patch_url":"https://github.com/framgia/brs_37/pull/15.patch","issue_url":"https://api.github.com/repos/framgia/brs_37/issues/15","number":15,"state":"open","locked":false,"title":"user login-logout","user":{"login":"quynhqtvn","id":20477357,"avatar_url":"https://avatars.githubusercontent.com/u/20477357?v=3","gravatar_id":"","url":"https://api.github.com/users/quynhqtvn","html_url":"https://github.com/quynhqtvn","followers_url":"https://api.github.com/users/quynhqtvn/followers","following_url":"https://api.github.com/users/quynhqtvn/following{/other_user}","gists_url":"https://api.github.com/users/quynhqtvn/gists{/gist_id}","starred_url":"https://api.github.com/users/quynhqtvn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quynhqtvn/subscriptions","organizations_url":"https://api.github.com/users/quynhqtvn/orgs","repos_url":"https://api.github.com/users/quynhqtvn/repos","events_url":"https://api.github.com/users/quynhqtvn/events{/privacy}","received_events_url":"https://api.github.com/users/quynhqtvn/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-03T10:29:27Z","updated_at":"2016-10-03T16:00:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7b180e723b6e35a845f24d2ab4fb89d2945dd29","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/brs_37/pulls/15/commits","review_comments_url":"https://api.github.com/repos/framgia/brs_37/pulls/15/comments","review_comment_url":"https://api.github.com/repos/framgia/brs_37/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/brs_37/issues/15/comments","statuses_url":"https://api.github.com/repos/framgia/brs_37/statuses/b68108dd0d64ac84a257101ad5e14cf4dd345758","head":{"label":"quynhqtvn:user-signup","ref":"user-signup","sha":"b68108dd0d64ac84a257101ad5e14cf4dd345758","user":{"login":"quynhqtvn","id":20477357,"avatar_url":"https://avatars.githubusercontent.com/u/20477357?v=3","gravatar_id":"","url":"https://api.github.com/users/quynhqtvn","html_url":"https://github.com/quynhqtvn","followers_url":"https://api.github.com/users/quynhqtvn/followers","following_url":"https://api.github.com/users/quynhqtvn/following{/other_user}","gists_url":"https://api.github.com/users/quynhqtvn/gists{/gist_id}","starred_url":"https://api.github.com/users/quynhqtvn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quynhqtvn/subscriptions","organizations_url":"https://api.github.com/users/quynhqtvn/orgs","repos_url":"https://api.github.com/users/quynhqtvn/repos","events_url":"https://api.github.com/users/quynhqtvn/events{/privacy}","received_events_url":"https://api.github.com/users/quynhqtvn/received_events","type":"User","site_admin":false},"repo":{"id":69746025,"name":"brs_37","full_name":"quynhqtvn/brs_37","owner":{"login":"quynhqtvn","id":20477357,"avatar_url":"https://avatars.githubusercontent.com/u/20477357?v=3","gravatar_id":"","url":"https://api.github.com/users/quynhqtvn","html_url":"https://github.com/quynhqtvn","followers_url":"https://api.github.com/users/quynhqtvn/followers","following_url":"https://api.github.com/users/quynhqtvn/following{/other_user}","gists_url":"https://api.github.com/users/quynhqtvn/gists{/gist_id}","starred_url":"https://api.github.com/users/quynhqtvn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quynhqtvn/subscriptions","organizations_url":"https://api.github.com/users/quynhqtvn/orgs","repos_url":"https://api.github.com/users/quynhqtvn/repos","events_url":"https://api.github.com/users/quynhqtvn/events{/privacy}","received_events_url":"https://api.github.com/users/quynhqtvn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/quynhqtvn/brs_37","description":"Framgia Book Reviewing System (training)","fork":true,"url":"https://api.github.com/repos/quynhqtvn/brs_37","forks_url":"https://api.github.com/repos/quynhqtvn/brs_37/forks","keys_url":"https://api.github.com/repos/quynhqtvn/brs_37/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quynhqtvn/brs_37/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quynhqtvn/brs_37/teams","hooks_url":"https://api.github.com/repos/quynhqtvn/brs_37/hooks","issue_events_url":"https://api.github.com/repos/quynhqtvn/brs_37/issues/events{/number}","events_url":"https://api.github.com/repos/quynhqtvn/brs_37/events","assignees_url":"https://api.github.com/repos/quynhqtvn/brs_37/assignees{/user}","branches_url":"https://api.github.com/repos/quynhqtvn/brs_37/branches{/branch}","tags_url":"https://api.github.com/repos/quynhqtvn/brs_37/tags","blobs_url":"https://api.github.com/repos/quynhqtvn/brs_37/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quynhqtvn/brs_37/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quynhqtvn/brs_37/git/refs{/sha}","trees_url":"https://api.github.com/repos/quynhqtvn/brs_37/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quynhqtvn/brs_37/statuses/{sha}","languages_url":"https://api.github.com/repos/quynhqtvn/brs_37/languages","stargazers_url":"https://api.github.com/repos/quynhqtvn/brs_37/stargazers","contributors_url":"https://api.github.com/repos/quynhqtvn/brs_37/contributors","subscribers_url":"https://api.github.com/repos/quynhqtvn/brs_37/subscribers","subscription_url":"https://api.github.com/repos/quynhqtvn/brs_37/subscription","commits_url":"https://api.github.com/repos/quynhqtvn/brs_37/commits{/sha}","git_commits_url":"https://api.github.com/repos/quynhqtvn/brs_37/git/commits{/sha}","comments_url":"https://api.github.com/repos/quynhqtvn/brs_37/comments{/number}","issue_comment_url":"https://api.github.com/repos/quynhqtvn/brs_37/issues/comments{/number}","contents_url":"https://api.github.com/repos/quynhqtvn/brs_37/contents/{+path}","compare_url":"https://api.github.com/repos/quynhqtvn/brs_37/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quynhqtvn/brs_37/merges","archive_url":"https://api.github.com/repos/quynhqtvn/brs_37/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quynhqtvn/brs_37/downloads","issues_url":"https://api.github.com/repos/quynhqtvn/brs_37/issues{/number}","pulls_url":"https://api.github.com/repos/quynhqtvn/brs_37/pulls{/number}","milestones_url":"https://api.github.com/repos/quynhqtvn/brs_37/milestones{/number}","notifications_url":"https://api.github.com/repos/quynhqtvn/brs_37/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quynhqtvn/brs_37/labels{/name}","releases_url":"https://api.github.com/repos/quynhqtvn/brs_37/releases{/id}","deployments_url":"https://api.github.com/repos/quynhqtvn/brs_37/deployments","created_at":"2016-10-01T15:19:25Z","updated_at":"2016-09-27T09:09:34Z","pushed_at":"2016-10-03T15:54:17Z","git_url":"git://github.com/quynhqtvn/brs_37.git","ssh_url":"git@github.com:quynhqtvn/brs_37.git","clone_url":"https://github.com/quynhqtvn/brs_37.git","svn_url":"https://github.com/quynhqtvn/brs_37","homepage":null,"size":42,"stargazers_count":0,"watchers_count":0,"language":null,"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":"master"}},"base":{"label":"framgia:develop","ref":"develop","sha":"9da3b4aa9267b341d540f943678eca8254fda6dc","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":69339061,"name":"brs_37","full_name":"framgia/brs_37","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_37","description":"Framgia Book Reviewing System (training)","fork":false,"url":"https://api.github.com/repos/framgia/brs_37","forks_url":"https://api.github.com/repos/framgia/brs_37/forks","keys_url":"https://api.github.com/repos/framgia/brs_37/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/brs_37/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/brs_37/teams","hooks_url":"https://api.github.com/repos/framgia/brs_37/hooks","issue_events_url":"https://api.github.com/repos/framgia/brs_37/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/brs_37/events","assignees_url":"https://api.github.com/repos/framgia/brs_37/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/brs_37/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/brs_37/tags","blobs_url":"https://api.github.com/repos/framgia/brs_37/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/brs_37/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/brs_37/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/brs_37/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/brs_37/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/brs_37/languages","stargazers_url":"https://api.github.com/repos/framgia/brs_37/stargazers","contributors_url":"https://api.github.com/repos/framgia/brs_37/contributors","subscribers_url":"https://api.github.com/repos/framgia/brs_37/subscribers","subscription_url":"https://api.github.com/repos/framgia/brs_37/subscription","commits_url":"https://api.github.com/repos/framgia/brs_37/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/brs_37/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/brs_37/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/brs_37/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/brs_37/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/brs_37/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/brs_37/merges","archive_url":"https://api.github.com/repos/framgia/brs_37/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/brs_37/downloads","issues_url":"https://api.github.com/repos/framgia/brs_37/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/brs_37/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/brs_37/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/brs_37/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/brs_37/labels{/name}","releases_url":"https://api.github.com/repos/framgia/brs_37/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/brs_37/deployments","created_at":"2016-09-27T09:09:34Z","updated_at":"2016-09-27T09:09:34Z","pushed_at":"2016-10-03T15:54:17Z","git_url":"git://github.com/framgia/brs_37.git","ssh_url":"git@github.com:framgia/brs_37.git","clone_url":"https://github.com/framgia/brs_37.git","svn_url":"https://github.com/framgia/brs_37","homepage":null,"size":79,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/brs_37/pulls/15"},"html":{"href":"https://github.com/framgia/brs_37/pull/15"},"issue":{"href":"https://api.github.com/repos/framgia/brs_37/issues/15"},"comments":{"href":"https://api.github.com/repos/framgia/brs_37/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/brs_37/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/brs_37/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/brs_37/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/brs_37/statuses/b68108dd0d64ac84a257101ad5e14cf4dd345758"}}}}
{"actor":{"display_login":"dieunb"}}