{"action":"created","comment":{"url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/comments/55625711","id":55625711,"diff_hunk":"@@ -1,10 +1,149 @@\n require './config/environment'\n+require 'pry'\n \n class ApplicationController < Sinatra::Base\n+  \n+  register Sinatra::ActiveRecordExtension\n \n   configure do\n     set :public_folder, 'public'\n     set :views, 'app/views'\n+    enable :sessions\n+    set :session_secret, \"its_a_secret\"\n   end\n \n+  get '/' do\n+    erb :index\n+  end\n+\n+  get '/signup' do\n+    if !is_logged_in\n+      erb :'registrations/signup'\n+    else\n+      redirect '/tweets'\n+    end \n+  end\n+\n+  post '/signup' do\n+    if params[:username] != '' && params[:password] != '' && params[:email] != ''\n+      @user = User.create(username: params[:username], password: params[:password], email: params[:email])\n+      session[:id] = @user.id\n+      redirect '/tweets'\n+    else \n+      redirect '/signup'\n+    end\n+  end\n+\n+  get '/tweets' do\n+    if is_logged_in\n+      @user = current_user\n+      @tweets = Tweet.all \n+      erb :'tweets/index'\n+    else\n+      redirect '/login'\n+    end\n+  end\n+\n+\n+  get '/login' do\n+    if !is_logged_in\n+      erb :'sessions/login'\n+    else\n+      redirect '/tweets'\n+    end\n+  end\n+\n+  post '/login' do\n+    @user = User.find_by(username: params[:username])\n+    if @user && @user.authenticate(params[:password])\n+      session[:id] = @user.id\n+      redirect '/tweets'\n+    else\n+      redirect '/login'\n+    end \n+  end\n+\n+  get '/tweets/new' do\n+    if is_logged_in\n+      erb :'tweets/create'\n+    else\n+      redirect '/login'\n+    end\n+  end\n+\n+  post '/tweets' do\n+    if !params[:content].empty? ","path":"app/controllers/application_controller.rb","position":75,"original_position":75,"commit_id":"5e9098dbb823c23d47207c9f4364e1ced525f658","original_commit_id":"5e9098dbb823c23d47207c9f4364e1ced525f658","user":{"login":"randallreedjr","id":2908283,"avatar_url":"https://avatars.githubusercontent.com/u/2908283?v=3","gravatar_id":"","url":"https://api.github.com/users/randallreedjr","html_url":"https://github.com/randallreedjr","followers_url":"https://api.github.com/users/randallreedjr/followers","following_url":"https://api.github.com/users/randallreedjr/following{/other_user}","gists_url":"https://api.github.com/users/randallreedjr/gists{/gist_id}","starred_url":"https://api.github.com/users/randallreedjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/randallreedjr/subscriptions","organizations_url":"https://api.github.com/users/randallreedjr/orgs","repos_url":"https://api.github.com/users/randallreedjr/repos","events_url":"https://api.github.com/users/randallreedjr/events{/privacy}","received_events_url":"https://api.github.com/users/randallreedjr/received_events","type":"User","site_admin":false},"body":"```\r\nclass Tweet < ActiveRecord::Base\r\n  validates_presence_of :content\r\n...\r\n```","created_at":"2016-03-10T02:19:48Z","updated_at":"2016-03-10T02:19:48Z","html_url":"https://github.com/learn-co-students/sinatra-fwitter-group-project-v-000/pull/35#discussion_r55625711","pull_request_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/comments/55625711"},"html":{"href":"https://github.com/learn-co-students/sinatra-fwitter-group-project-v-000/pull/35#discussion_r55625711"},"pull_request":{"href":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/35","id":59675947,"html_url":"https://github.com/learn-co-students/sinatra-fwitter-group-project-v-000/pull/35","diff_url":"https://github.com/learn-co-students/sinatra-fwitter-group-project-v-000/pull/35.diff","patch_url":"https://github.com/learn-co-students/sinatra-fwitter-group-project-v-000/pull/35.patch","issue_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/issues/35","number":35,"state":"open","locked":false,"title":"Done","user":{"login":"jsgoldb","id":10102197,"avatar_url":"https://avatars.githubusercontent.com/u/10102197?v=3","gravatar_id":"","url":"https://api.github.com/users/jsgoldb","html_url":"https://github.com/jsgoldb","followers_url":"https://api.github.com/users/jsgoldb/followers","following_url":"https://api.github.com/users/jsgoldb/following{/other_user}","gists_url":"https://api.github.com/users/jsgoldb/gists{/gist_id}","starred_url":"https://api.github.com/users/jsgoldb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsgoldb/subscriptions","organizations_url":"https://api.github.com/users/jsgoldb/orgs","repos_url":"https://api.github.com/users/jsgoldb/repos","events_url":"https://api.github.com/users/jsgoldb/events{/privacy}","received_events_url":"https://api.github.com/users/jsgoldb/received_events","type":"User","site_admin":false},"body":null,"created_at":"2016-02-17T17:08:34Z","updated_at":"2016-03-10T02:19:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a0475950f2a46b7e08c66cadab57bdb7c6723357","assignee":{"login":"randallreedjr","id":2908283,"avatar_url":"https://avatars.githubusercontent.com/u/2908283?v=3","gravatar_id":"","url":"https://api.github.com/users/randallreedjr","html_url":"https://github.com/randallreedjr","followers_url":"https://api.github.com/users/randallreedjr/followers","following_url":"https://api.github.com/users/randallreedjr/following{/other_user}","gists_url":"https://api.github.com/users/randallreedjr/gists{/gist_id}","starred_url":"https://api.github.com/users/randallreedjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/randallreedjr/subscriptions","organizations_url":"https://api.github.com/users/randallreedjr/orgs","repos_url":"https://api.github.com/users/randallreedjr/repos","events_url":"https://api.github.com/users/randallreedjr/events{/privacy}","received_events_url":"https://api.github.com/users/randallreedjr/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/35/commits","review_comments_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/35/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/35/comments","statuses_url":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/statuses/5e9098dbb823c23d47207c9f4364e1ced525f658","head":{"label":"jsgoldb:master","ref":"master","sha":"5e9098dbb823c23d47207c9f4364e1ced525f658","user":{"login":"jsgoldb","id":10102197,"avatar_url":"https://avatars.githubusercontent.com/u/10102197?v=3","gravatar_id":"","url":"https://api.github.com/users/jsgoldb","html_url":"https://github.com/jsgoldb","followers_url":"https://api.github.com/users/jsgoldb/followers","following_url":"https://api.github.com/users/jsgoldb/following{/other_user}","gists_url":"https://api.github.com/users/jsgoldb/gists{/gist_id}","starred_url":"https://api.github.com/users/jsgoldb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsgoldb/subscriptions","organizations_url":"https://api.github.com/users/jsgoldb/orgs","repos_url":"https://api.github.com/users/jsgoldb/repos","events_url":"https://api.github.com/users/jsgoldb/events{/privacy}","received_events_url":"https://api.github.com/users/jsgoldb/received_events","type":"User","site_admin":false},"repo":{"id":51531095,"name":"sinatra-fwitter-group-project-v-000","full_name":"jsgoldb/sinatra-fwitter-group-project-v-000","owner":{"login":"jsgoldb","id":10102197,"avatar_url":"https://avatars.githubusercontent.com/u/10102197?v=3","gravatar_id":"","url":"https://api.github.com/users/jsgoldb","html_url":"https://github.com/jsgoldb","followers_url":"https://api.github.com/users/jsgoldb/followers","following_url":"https://api.github.com/users/jsgoldb/following{/other_user}","gists_url":"https://api.github.com/users/jsgoldb/gists{/gist_id}","starred_url":"https://api.github.com/users/jsgoldb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsgoldb/subscriptions","organizations_url":"https://api.github.com/users/jsgoldb/orgs","repos_url":"https://api.github.com/users/jsgoldb/repos","events_url":"https://api.github.com/users/jsgoldb/events{/privacy}","received_events_url":"https://api.github.com/users/jsgoldb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jsgoldb/sinatra-fwitter-group-project-v-000","description":null,"fork":true,"url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000","forks_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/forks","keys_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/teams","hooks_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/hooks","issue_events_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/issues/events{/number}","events_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/events","assignees_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/assignees{/user}","branches_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/branches{/branch}","tags_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/tags","blobs_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/git/refs{/sha}","trees_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/statuses/{sha}","languages_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/languages","stargazers_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/stargazers","contributors_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/contributors","subscribers_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/subscribers","subscription_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/subscription","commits_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/commits{/sha}","git_commits_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/git/commits{/sha}","comments_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/comments{/number}","issue_comment_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/issues/comments{/number}","contents_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/contents/{+path}","compare_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/merges","archive_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/downloads","issues_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/issues{/number}","pulls_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/pulls{/number}","milestones_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/milestones{/number}","notifications_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/labels{/name}","releases_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/releases{/id}","deployments_url":"https://api.github.com/repos/jsgoldb/sinatra-fwitter-group-project-v-000/deployments","created_at":"2016-02-11T17:13:27Z","updated_at":"2016-02-11T17:13:28Z","pushed_at":"2016-02-17T17:08:30Z","git_url":"git://github.com/jsgoldb/sinatra-fwitter-group-project-v-000.git","ssh_url":"git@github.com:jsgoldb/sinatra-fwitter-group-project-v-000.git","clone_url":"https://github.com/jsgoldb/sinatra-fwitter-group-project-v-000.git","svn_url":"https://github.com/jsgoldb/sinatra-fwitter-group-project-v-000","homepage":null,"size":42,"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":"master"}},"base":{"label":"learn-co-students:master","ref":"master","sha":"2d9f3ba5accfe33ac0da9977a4031e1d3dba0ce3","user":{"login":"learn-co-students","id":8825476,"avatar_url":"https://avatars.githubusercontent.com/u/8825476?v=3","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,"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,"avatar_url":"https://avatars.githubusercontent.com/u/8825476?v=3","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":"2016-03-08T20:27:19Z","pushed_at":"2016-03-09T00:59:50Z","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":23496,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":56,"mirror_url":null,"open_issues_count":21,"forks":56,"open_issues":21,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/35"},"html":{"href":"https://github.com/learn-co-students/sinatra-fwitter-group-project-v-000/pull/35"},"issue":{"href":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/issues/35"},"comments":{"href":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/pulls/35/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/35/commits"},"statuses":{"href":"https://api.github.com/repos/learn-co-students/sinatra-fwitter-group-project-v-000/statuses/5e9098dbb823c23d47207c9f4364e1ced525f658"}}}}