{"action":"created","comment":{"url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/pulls/comments/31469230","id":31469230,"diff_hunk":"@@ -1,20 +1,73 @@\n class KeysController < ApplicationController\n-  before_action :require_login, only: [:new, :create]\n-\n+  before_action :require_login, only: [:show, :new, :edit, :delete]\n+  before_action :get_key, only: [:update, :used_at, :delete]\n   def show\n \n   end\n \n+  def new\n+    @key = Key.new\n+    respond_to do |format|\n+      if request.xhr?\n+        format.html { render :new, layout: false}\n+      else\n+        format.html { render :new }\n+      end\n+    end\n+  end\n+\n   def create\n+    new_key = Key.new(get_params)\n+    if new_key.save\n+      send_mail new_key\n+      flash[:success] = \"New key created\"\n+      redirect_to user_path(current_user)\n+    else\n+      flash[:error] = \"Key could not be created :(\"\n+      redirect_to user_path(current_user)\n+    end\n+  end\n+\n+  def edit\n \n   end\n \n   def update\n+    key = Key.find_by(id: params[:id])\n+    if key.update_attributes(get_params)\n+      flash[:success] = \"Key has been updated!\"\n+    else\n+      flash[:error] = \"Key could not be updated :(\"\n+    end\n+    redirect_to :back","path":"app/controllers/keys_controller.rb","position":44,"original_position":44,"commit_id":"5071e7eccf34a96fdb21f3b1af71d8a7a3b96c16","original_commit_id":"5071e7eccf34a96fdb21f3b1af71d8a7a3b96c16","user":{"login":"stevecass","id":1823156,"avatar_url":"https://avatars.githubusercontent.com/u/1823156?v=3","gravatar_id":"","url":"https://api.github.com/users/stevecass","html_url":"https://github.com/stevecass","followers_url":"https://api.github.com/users/stevecass/followers","following_url":"https://api.github.com/users/stevecass/following{/other_user}","gists_url":"https://api.github.com/users/stevecass/gists{/gist_id}","starred_url":"https://api.github.com/users/stevecass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevecass/subscriptions","organizations_url":"https://api.github.com/users/stevecass/orgs","repos_url":"https://api.github.com/users/stevecass/repos","events_url":"https://api.github.com/users/stevecass/events{/privacy}","received_events_url":"https://api.github.com/users/stevecass/received_events","type":"User","site_admin":false},"body":"better. You clearly magically read the comment above...","created_at":"2015-06-01T20:55:55Z","updated_at":"2015-06-01T20:55:55Z","html_url":"https://github.com/nyc-pocket-gophers-2015/Entra/pull/31#discussion_r31469230","pull_request_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/pulls/comments/31469230"},"html":{"href":"https://github.com/nyc-pocket-gophers-2015/Entra/pull/31#discussion_r31469230"},"pull_request":{"href":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/pulls/31","id":36668938,"html_url":"https://github.com/nyc-pocket-gophers-2015/Entra/pull/31","diff_url":"https://github.com/nyc-pocket-gophers-2015/Entra/pull/31.diff","patch_url":"https://github.com/nyc-pocket-gophers-2015/Entra/pull/31.patch","issue_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/issues/31","number":31,"state":"open","locked":false,"title":"Don't merge - review","user":{"login":"stevecass","id":1823156,"avatar_url":"https://avatars.githubusercontent.com/u/1823156?v=3","gravatar_id":"","url":"https://api.github.com/users/stevecass","html_url":"https://github.com/stevecass","followers_url":"https://api.github.com/users/stevecass/followers","following_url":"https://api.github.com/users/stevecass/following{/other_user}","gists_url":"https://api.github.com/users/stevecass/gists{/gist_id}","starred_url":"https://api.github.com/users/stevecass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevecass/subscriptions","organizations_url":"https://api.github.com/users/stevecass/orgs","repos_url":"https://api.github.com/users/stevecass/repos","events_url":"https://api.github.com/users/stevecass/events{/privacy}","received_events_url":"https://api.github.com/users/stevecass/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-01T20:46:14Z","updated_at":"2015-06-01T20:55:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4001368791c7e429adeab4efdae15925099351cd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/pulls/31/commits","review_comments_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/pulls/31/comments","review_comment_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/issues/31/comments","statuses_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/statuses/5071e7eccf34a96fdb21f3b1af71d8a7a3b96c16","head":{"label":"nyc-pocket-gophers-2015:sc_review","ref":"sc_review","sha":"5071e7eccf34a96fdb21f3b1af71d8a7a3b96c16","user":{"login":"nyc-pocket-gophers-2015","id":10661474,"avatar_url":"https://avatars.githubusercontent.com/u/10661474?v=3","gravatar_id":"","url":"https://api.github.com/users/nyc-pocket-gophers-2015","html_url":"https://github.com/nyc-pocket-gophers-2015","followers_url":"https://api.github.com/users/nyc-pocket-gophers-2015/followers","following_url":"https://api.github.com/users/nyc-pocket-gophers-2015/following{/other_user}","gists_url":"https://api.github.com/users/nyc-pocket-gophers-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/nyc-pocket-gophers-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyc-pocket-gophers-2015/subscriptions","organizations_url":"https://api.github.com/users/nyc-pocket-gophers-2015/orgs","repos_url":"https://api.github.com/users/nyc-pocket-gophers-2015/repos","events_url":"https://api.github.com/users/nyc-pocket-gophers-2015/events{/privacy}","received_events_url":"https://api.github.com/users/nyc-pocket-gophers-2015/received_events","type":"Organization","site_admin":false},"repo":{"id":36468974,"name":"Entra","full_name":"nyc-pocket-gophers-2015/Entra","owner":{"login":"nyc-pocket-gophers-2015","id":10661474,"avatar_url":"https://avatars.githubusercontent.com/u/10661474?v=3","gravatar_id":"","url":"https://api.github.com/users/nyc-pocket-gophers-2015","html_url":"https://github.com/nyc-pocket-gophers-2015","followers_url":"https://api.github.com/users/nyc-pocket-gophers-2015/followers","following_url":"https://api.github.com/users/nyc-pocket-gophers-2015/following{/other_user}","gists_url":"https://api.github.com/users/nyc-pocket-gophers-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/nyc-pocket-gophers-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyc-pocket-gophers-2015/subscriptions","organizations_url":"https://api.github.com/users/nyc-pocket-gophers-2015/orgs","repos_url":"https://api.github.com/users/nyc-pocket-gophers-2015/repos","events_url":"https://api.github.com/users/nyc-pocket-gophers-2015/events{/privacy}","received_events_url":"https://api.github.com/users/nyc-pocket-gophers-2015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nyc-pocket-gophers-2015/Entra","description":"Entra - Give access to your apartment building remotely","fork":false,"url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra","forks_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/forks","keys_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/teams","hooks_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/hooks","issue_events_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/issues/events{/number}","events_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/events","assignees_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/assignees{/user}","branches_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/branches{/branch}","tags_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/tags","blobs_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/git/refs{/sha}","trees_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/statuses/{sha}","languages_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/languages","stargazers_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/stargazers","contributors_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/contributors","subscribers_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/subscribers","subscription_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/subscription","commits_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/commits{/sha}","git_commits_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/git/commits{/sha}","comments_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/comments{/number}","issue_comment_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/issues/comments{/number}","contents_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/contents/{+path}","compare_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/merges","archive_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/downloads","issues_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/issues{/number}","pulls_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/pulls{/number}","milestones_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/milestones{/number}","notifications_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/labels{/name}","releases_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/releases{/id}","created_at":"2015-05-28T22:11:31Z","updated_at":"2015-05-28T22:16:54Z","pushed_at":"2015-06-01T20:46:14Z","git_url":"git://github.com/nyc-pocket-gophers-2015/Entra.git","ssh_url":"git@github.com:nyc-pocket-gophers-2015/Entra.git","clone_url":"https://github.com/nyc-pocket-gophers-2015/Entra.git","svn_url":"https://github.com/nyc-pocket-gophers-2015/Entra","homepage":null,"size":554,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"nyc-pocket-gophers-2015:sc_review_base","ref":"sc_review_base","sha":"284745e9373d9b2b7c4ddab553f8a473ca73fbac","user":{"login":"nyc-pocket-gophers-2015","id":10661474,"avatar_url":"https://avatars.githubusercontent.com/u/10661474?v=3","gravatar_id":"","url":"https://api.github.com/users/nyc-pocket-gophers-2015","html_url":"https://github.com/nyc-pocket-gophers-2015","followers_url":"https://api.github.com/users/nyc-pocket-gophers-2015/followers","following_url":"https://api.github.com/users/nyc-pocket-gophers-2015/following{/other_user}","gists_url":"https://api.github.com/users/nyc-pocket-gophers-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/nyc-pocket-gophers-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyc-pocket-gophers-2015/subscriptions","organizations_url":"https://api.github.com/users/nyc-pocket-gophers-2015/orgs","repos_url":"https://api.github.com/users/nyc-pocket-gophers-2015/repos","events_url":"https://api.github.com/users/nyc-pocket-gophers-2015/events{/privacy}","received_events_url":"https://api.github.com/users/nyc-pocket-gophers-2015/received_events","type":"Organization","site_admin":false},"repo":{"id":36468974,"name":"Entra","full_name":"nyc-pocket-gophers-2015/Entra","owner":{"login":"nyc-pocket-gophers-2015","id":10661474,"avatar_url":"https://avatars.githubusercontent.com/u/10661474?v=3","gravatar_id":"","url":"https://api.github.com/users/nyc-pocket-gophers-2015","html_url":"https://github.com/nyc-pocket-gophers-2015","followers_url":"https://api.github.com/users/nyc-pocket-gophers-2015/followers","following_url":"https://api.github.com/users/nyc-pocket-gophers-2015/following{/other_user}","gists_url":"https://api.github.com/users/nyc-pocket-gophers-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/nyc-pocket-gophers-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyc-pocket-gophers-2015/subscriptions","organizations_url":"https://api.github.com/users/nyc-pocket-gophers-2015/orgs","repos_url":"https://api.github.com/users/nyc-pocket-gophers-2015/repos","events_url":"https://api.github.com/users/nyc-pocket-gophers-2015/events{/privacy}","received_events_url":"https://api.github.com/users/nyc-pocket-gophers-2015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nyc-pocket-gophers-2015/Entra","description":"Entra - Give access to your apartment building remotely","fork":false,"url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra","forks_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/forks","keys_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/teams","hooks_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/hooks","issue_events_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/issues/events{/number}","events_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/events","assignees_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/assignees{/user}","branches_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/branches{/branch}","tags_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/tags","blobs_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/git/refs{/sha}","trees_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/statuses/{sha}","languages_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/languages","stargazers_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/stargazers","contributors_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/contributors","subscribers_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/subscribers","subscription_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/subscription","commits_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/commits{/sha}","git_commits_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/git/commits{/sha}","comments_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/comments{/number}","issue_comment_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/issues/comments{/number}","contents_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/contents/{+path}","compare_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/merges","archive_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/downloads","issues_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/issues{/number}","pulls_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/pulls{/number}","milestones_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/milestones{/number}","notifications_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/labels{/name}","releases_url":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/releases{/id}","created_at":"2015-05-28T22:11:31Z","updated_at":"2015-05-28T22:16:54Z","pushed_at":"2015-06-01T20:46:14Z","git_url":"git://github.com/nyc-pocket-gophers-2015/Entra.git","ssh_url":"git@github.com:nyc-pocket-gophers-2015/Entra.git","clone_url":"https://github.com/nyc-pocket-gophers-2015/Entra.git","svn_url":"https://github.com/nyc-pocket-gophers-2015/Entra","homepage":null,"size":554,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/pulls/31"},"html":{"href":"https://github.com/nyc-pocket-gophers-2015/Entra/pull/31"},"issue":{"href":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/issues/31"},"comments":{"href":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/nyc-pocket-gophers-2015/Entra/statuses/5071e7eccf34a96fdb21f3b1af71d8a7a3b96c16"}}}}