{"action":"created","comment":{"url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/comments/192953092","pull_request_review_id":125826446,"id":192953092,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Mjk1MzA5Mg==","diff_hunk":"@@ -5,6 +5,22 @@ class ApplicationController < Sinatra::Base\n   configure do\n     set :public_folder, 'public'\n     set :views, 'app/views'\n+    enable :sessions\n+    set :session_secret, \"password_security\"\n   end\n \n-end\n\\ No newline at end of file\n+  get '/' do\n+    erb :\"/index\"\n+  end\n+\n+\n+  helpers do\n+    def logged_in?\n+      !!session[:user_id]\n+    end\n+\n+    def current_user","path":"app/controllers/application_controller.rb","position":20,"original_position":20,"commit_id":"856524a50ed115cd18ea8baae3870b116251254a","original_commit_id":"856524a50ed115cd18ea8baae3870b116251254a","user":{"login":"cernanb","id":7960757,"node_id":"MDQ6VXNlcjc5NjA3NTc=","avatar_url":"https://avatars1.githubusercontent.com/u/7960757?v=4","gravatar_id":"","url":"https://api.github.com/users/cernanb","html_url":"https://github.com/cernanb","followers_url":"https://api.github.com/users/cernanb/followers","following_url":"https://api.github.com/users/cernanb/following{/other_user}","gists_url":"https://api.github.com/users/cernanb/gists{/gist_id}","starred_url":"https://api.github.com/users/cernanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cernanb/subscriptions","organizations_url":"https://api.github.com/users/cernanb/orgs","repos_url":"https://api.github.com/users/cernanb/repos","events_url":"https://api.github.com/users/cernanb/events{/privacy}","received_events_url":"https://api.github.com/users/cernanb/received_events","type":"User","site_admin":false},"body":"Because in the lifespan of a request, you might call `current_user` multiple times, we'd prefer this method to only hit the database once and then 'cache' the user instance into an instance variable that could be returned on any subsequent call to `current_user`.\r\n\r\n```ruby\r\ndef current_user\r\n  @current_user ||= User.find(session[:id]) if session[:id]\r\nend\r\n```\r\n\r\nThis pattern of conditionally setting an instance variable or returning it if it's already defined using the `||=` (or-equals) operator is called Memoization ([read more](http://gavinmiller.io/2013/basics-of-ruby-memoization/) and [here](http://www.justinweiss.com/articles/4-simple-memoization-patterns-in-ruby-and-one-gem/)).","created_at":"2018-06-05T05:53:44Z","updated_at":"2018-06-05T05:59:47Z","html_url":"https://github.com/learn-co-students/sinatra-fwitter-group-project-v-000/pull/752#discussion_r192953092","pull_request_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/752","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/comments/192953092"},"html":{"href":"https://github.com/learn-co-students/sinatra-fwitter-group-project-v-000/pull/752#discussion_r192953092"},"pull_request":{"href":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/752"}}},"pull_request":{"url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/752","id":186234912,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg2MjM0OTEy","html_url":"https://github.com/learn-co-students/sinatra-fwitter-group-project-v-000/pull/752","diff_url":"https://github.com/learn-co-students/sinatra-fwitter-group-project-v-000/pull/752.diff","patch_url":"https://github.com/learn-co-students/sinatra-fwitter-group-project-v-000/pull/752.patch","issue_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/issues/752","number":752,"state":"open","locked":false,"title":"Done","user":{"login":"MFeuer23","id":35772416,"node_id":"MDQ6VXNlcjM1NzcyNDE2","avatar_url":"https://avatars1.githubusercontent.com/u/35772416?v=4","gravatar_id":"","url":"https://api.github.com/users/MFeuer23","html_url":"https://github.com/MFeuer23","followers_url":"https://api.github.com/users/MFeuer23/followers","following_url":"https://api.github.com/users/MFeuer23/following{/other_user}","gists_url":"https://api.github.com/users/MFeuer23/gists{/gist_id}","starred_url":"https://api.github.com/users/MFeuer23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MFeuer23/subscriptions","organizations_url":"https://api.github.com/users/MFeuer23/orgs","repos_url":"https://api.github.com/users/MFeuer23/repos","events_url":"https://api.github.com/users/MFeuer23/events{/privacy}","received_events_url":"https://api.github.com/users/MFeuer23/received_events","type":"User","site_admin":false},"body":null,"created_at":"2018-05-07T00:27:23Z","updated_at":"2018-06-05T05:59:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ef58e94329631baa467796e63d9d85259b8f6b6e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/752/commits","review_comments_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/752/comments","review_comment_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/comments{/number}","comments_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/issues/752/comments","statuses_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/statuses/856524a50ed115cd18ea8baae3870b116251254a","head":{"label":"MFeuer23:master","ref":"master","sha":"856524a50ed115cd18ea8baae3870b116251254a","user":{"login":"MFeuer23","id":35772416,"node_id":"MDQ6VXNlcjM1NzcyNDE2","avatar_url":"https://avatars1.githubusercontent.com/u/35772416?v=4","gravatar_id":"","url":"https://api.github.com/users/MFeuer23","html_url":"https://github.com/MFeuer23","followers_url":"https://api.github.com/users/MFeuer23/followers","following_url":"https://api.github.com/users/MFeuer23/following{/other_user}","gists_url":"https://api.github.com/users/MFeuer23/gists{/gist_id}","starred_url":"https://api.github.com/users/MFeuer23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MFeuer23/subscriptions","organizations_url":"https://api.github.com/users/MFeuer23/orgs","repos_url":"https://api.github.com/users/MFeuer23/repos","events_url":"https://api.github.com/users/MFeuer23/events{/privacy}","received_events_url":"https://api.github.com/users/MFeuer23/received_events","type":"User","site_admin":false},"repo":{"id":132376931,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIzNzY5MzE=","name":"sinatra-fwitter-group-project-v-000","full_name":"MFeuer23/sinatra-fwitter-group-project-v-000","owner":{"login":"MFeuer23","id":35772416,"node_id":"MDQ6VXNlcjM1NzcyNDE2","avatar_url":"https://avatars1.githubusercontent.com/u/35772416?v=4","gravatar_id":"","url":"https://api.github.com/users/MFeuer23","html_url":"https://github.com/MFeuer23","followers_url":"https://api.github.com/users/MFeuer23/followers","following_url":"https://api.github.com/users/MFeuer23/following{/other_user}","gists_url":"https://api.github.com/users/MFeuer23/gists{/gist_id}","starred_url":"https://api.github.com/users/MFeuer23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MFeuer23/subscriptions","organizations_url":"https://api.github.com/users/MFeuer23/orgs","repos_url":"https://api.github.com/users/MFeuer23/repos","events_url":"https://api.github.com/users/MFeuer23/events{/privacy}","received_events_url":"https://api.github.com/users/MFeuer23/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MFeuer23/sinatra-fwitter-group-project-v-000","description":null,"fork":true,"url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000","forks_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/forks","keys_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/teams","hooks_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/hooks","issue_events_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/issues/events{/number}","events_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/events","assignees_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/assignees{/user}","branches_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/branches{/branch}","tags_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/tags","blobs_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/git/refs{/sha}","trees_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/statuses/{sha}","languages_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/languages","stargazers_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/stargazers","contributors_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/contributors","subscribers_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/subscribers","subscription_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/subscription","commits_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/commits{/sha}","git_commits_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/git/commits{/sha}","comments_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/comments{/number}","issue_comment_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/issues/comments{/number}","contents_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/contents/{+path}","compare_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/merges","archive_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/downloads","issues_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/issues{/number}","pulls_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/pulls{/number}","milestones_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/milestones{/number}","notifications_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/labels{/name}","releases_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/releases{/id}","deployments_url":"https://api.github.com/repos/MFeuer23/sinatra-fwitter-group-project-v-000/deployments","created_at":"2018-05-06T21:19:56Z","updated_at":"2018-05-07T00:34:14Z","pushed_at":"2018-05-08T14:15:00Z","git_url":"git://github.com/MFeuer23/sinatra-fwitter-group-project-v-000.git","ssh_url":"git@github.com:MFeuer23/sinatra-fwitter-group-project-v-000.git","clone_url":"https://github.com/MFeuer23/sinatra-fwitter-group-project-v-000.git","svn_url":"https://github.com/MFeuer23/sinatra-fwitter-group-project-v-000","homepage":null,"size":68,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"learn-co-students:master","ref":"master","sha":"b9f1f801b1932a181034de9f9534d64e64c338d6","user":{"login":"learn-co-students","id":8825476,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4MjU0NzY=","avatar_url":"https://avatars3.githubusercontent.com/u/8825476?v=4","gravatar_id":"","url":"https://api.github.com/users/learn-co-students","html_url":"https://github.com/learn-co-students","followers_url":"https://api.github.com/users/learn-co-students/followers","following_url":"https://api.github.com/users/learn-co-students/following{/other_user}","gists_url":"https://api.github.com/users/learn-co-students/gists{/gist_id}","starred_url":"https://api.github.com/users/learn-co-students/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learn-co-students/subscriptions","organizations_url":"https://api.github.com/users/learn-co-students/orgs","repos_url":"https://api.github.com/users/learn-co-students/repos","events_url":"https://api.github.com/users/learn-co-students/events{/privacy}","received_events_url":"https://api.github.com/users/learn-co-students/received_events","type":"Organization","site_admin":false},"repo":{"id":48708806,"node_id":"MDEwOlJlcG9zaXRvcnk0ODcwODgwNg==","name":"sinatra-fwitter-group-project-v-000","full_name":"learn-co-students/sinatra-fwitter-group-project-v-000","owner":{"login":"learn-co-students","id":8825476,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4MjU0NzY=","avatar_url":"https://avatars3.githubusercontent.com/u/8825476?v=4","gravatar_id":"","url":"https://api.github.com/users/learn-co-students","html_url":"https://github.com/learn-co-students","followers_url":"https://api.github.com/users/learn-co-students/followers","following_url":"https://api.github.com/users/learn-co-students/following{/other_user}","gists_url":"https://api.github.com/users/learn-co-students/gists{/gist_id}","starred_url":"https://api.github.com/users/learn-co-students/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learn-co-students/subscriptions","organizations_url":"https://api.github.com/users/learn-co-students/orgs","repos_url":"https://api.github.com/users/learn-co-students/repos","events_url":"https://api.github.com/users/learn-co-students/events{/privacy}","received_events_url":"https://api.github.com/users/learn-co-students/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/learn-co-students/sinatra-fwitter-group-project-v-000","description":null,"fork":false,"url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000","forks_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/forks","keys_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/keys{/key_id}","collaborators_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/teams","hooks_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/hooks","issue_events_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/issues/events{/number}","events_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/events","assignees_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/assignees{/user}","branches_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/branches{/branch}","tags_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/tags","blobs_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/git/refs{/sha}","trees_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/git/trees{/sha}","statuses_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/statuses/{sha}","languages_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/languages","stargazers_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/stargazers","contributors_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/contributors","subscribers_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/subscribers","subscription_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/subscription","commits_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/commits{/sha}","git_commits_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/git/commits{/sha}","comments_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/comments{/number}","issue_comment_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/issues/comments{/number}","contents_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/contents/{+path}","compare_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/compare/{base}...{head}","merges_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/merges","archive_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/downloads","issues_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/issues{/number}","pulls_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls{/number}","milestones_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/milestones{/number}","notifications_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/labels{/name}","releases_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/releases{/id}","deployments_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/deployments","created_at":"2015-12-28T19:27:58Z","updated_at":"2018-05-22T17:51:20Z","pushed_at":"2018-06-03T20:41:34Z","git_url":"git://github.com/learn-co-students/sinatra-fwitter-group-project-v-000.git","ssh_url":"git@github.com:learn-co-students/sinatra-fwitter-group-project-v-000.git","clone_url":"https://github.com/learn-co-students/sinatra-fwitter-group-project-v-000.git","svn_url":"https://github.com/learn-co-students/sinatra-fwitter-group-project-v-000","homepage":null,"size":67,"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":809,"mirror_url":null,"archived":false,"open_issues_count":696,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":809,"open_issues":696,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/752"},"html":{"href":"https://github.com/learn-co-students/sinatra-fwitter-group-project-v-000/pull/752"},"issue":{"href":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/issues/752"},"comments":{"href":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/issues/752/comments"},"review_comments":{"href":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/752/comments"},"review_comment":{"href":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/752/commits"},"statuses":{"href":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/statuses/856524a50ed115cd18ea8baae3870b116251254a"}},"author_association":"NONE"}}
{"actor":{"display_login":"cernanb"}}