{"action":"created","comment":{"url":"https://api.github.com/repos/faethonm/sviper/pulls/comments/71198059","id":71198059,"diff_hunk":"@@ -2,15 +2,15 @@\n module CandidateApplicationSteps\n   class AttachmentsController < CandidateApplicationStepsController\n     def edit\n-      @attachment = if current_user.attachment.present?","path":"app/controllers/candidate_application_steps/attachments_controller.rb","position":null,"original_position":4,"commit_id":"02dd8a62106f2ccf8c46c92ff07a5d00c3368d78","original_commit_id":"3907ad74817bd074802174c4b6b0f797a988b625","user":{"login":"cionescu","id":3137291,"avatar_url":"https://avatars.githubusercontent.com/u/3137291?v=3","gravatar_id":"","url":"https://api.github.com/users/cionescu","html_url":"https://github.com/cionescu","followers_url":"https://api.github.com/users/cionescu/followers","following_url":"https://api.github.com/users/cionescu/following{/other_user}","gists_url":"https://api.github.com/users/cionescu/gists{/gist_id}","starred_url":"https://api.github.com/users/cionescu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cionescu/subscriptions","organizations_url":"https://api.github.com/users/cionescu/orgs","repos_url":"https://api.github.com/users/cionescu/repos","events_url":"https://api.github.com/users/cionescu/events{/privacy}","received_events_url":"https://api.github.com/users/cionescu/received_events","type":"User","site_admin":false},"body":"You could write this as \r\n```ruby\r\n@attachment = Attachment.find_or_create_by(candidate_application_id: @candidate_application.id)\r\n```\r\nhence getting rid of the if / else","created_at":"2016-07-18T18:07:42Z","updated_at":"2016-07-18T18:07:42Z","html_url":"https://github.com/faethonm/sviper/pull/6#discussion_r71198059","pull_request_url":"https://api.github.com/repos/faethonm/sviper/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/faethonm/sviper/pulls/comments/71198059"},"html":{"href":"https://github.com/faethonm/sviper/pull/6#discussion_r71198059"},"pull_request":{"href":"https://api.github.com/repos/faethonm/sviper/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/faethonm/sviper/pulls/6","id":77779211,"html_url":"https://github.com/faethonm/sviper/pull/6","diff_url":"https://github.com/faethonm/sviper/pull/6.diff","patch_url":"https://github.com/faethonm/sviper/pull/6.patch","issue_url":"https://api.github.com/repos/faethonm/sviper/issues/6","number":6,"state":"open","locked":false,"title":"Admin users","user":{"login":"faethonm","id":874412,"avatar_url":"https://avatars.githubusercontent.com/u/874412?v=3","gravatar_id":"","url":"https://api.github.com/users/faethonm","html_url":"https://github.com/faethonm","followers_url":"https://api.github.com/users/faethonm/followers","following_url":"https://api.github.com/users/faethonm/following{/other_user}","gists_url":"https://api.github.com/users/faethonm/gists{/gist_id}","starred_url":"https://api.github.com/users/faethonm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faethonm/subscriptions","organizations_url":"https://api.github.com/users/faethonm/orgs","repos_url":"https://api.github.com/users/faethonm/repos","events_url":"https://api.github.com/users/faethonm/events{/privacy}","received_events_url":"https://api.github.com/users/faethonm/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-18T09:23:29Z","updated_at":"2016-07-18T18:07:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"275798f490ceefeed2a01890544a159ed883b90a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/faethonm/sviper/pulls/6/commits","review_comments_url":"https://api.github.com/repos/faethonm/sviper/pulls/6/comments","review_comment_url":"https://api.github.com/repos/faethonm/sviper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/faethonm/sviper/issues/6/comments","statuses_url":"https://api.github.com/repos/faethonm/sviper/statuses/02dd8a62106f2ccf8c46c92ff07a5d00c3368d78","head":{"label":"faethonm:admin_users","ref":"admin_users","sha":"02dd8a62106f2ccf8c46c92ff07a5d00c3368d78","user":{"login":"faethonm","id":874412,"avatar_url":"https://avatars.githubusercontent.com/u/874412?v=3","gravatar_id":"","url":"https://api.github.com/users/faethonm","html_url":"https://github.com/faethonm","followers_url":"https://api.github.com/users/faethonm/followers","following_url":"https://api.github.com/users/faethonm/following{/other_user}","gists_url":"https://api.github.com/users/faethonm/gists{/gist_id}","starred_url":"https://api.github.com/users/faethonm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faethonm/subscriptions","organizations_url":"https://api.github.com/users/faethonm/orgs","repos_url":"https://api.github.com/users/faethonm/repos","events_url":"https://api.github.com/users/faethonm/events{/privacy}","received_events_url":"https://api.github.com/users/faethonm/received_events","type":"User","site_admin":false},"repo":{"id":62907286,"name":"sviper","full_name":"faethonm/sviper","owner":{"login":"faethonm","id":874412,"avatar_url":"https://avatars.githubusercontent.com/u/874412?v=3","gravatar_id":"","url":"https://api.github.com/users/faethonm","html_url":"https://github.com/faethonm","followers_url":"https://api.github.com/users/faethonm/followers","following_url":"https://api.github.com/users/faethonm/following{/other_user}","gists_url":"https://api.github.com/users/faethonm/gists{/gist_id}","starred_url":"https://api.github.com/users/faethonm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faethonm/subscriptions","organizations_url":"https://api.github.com/users/faethonm/orgs","repos_url":"https://api.github.com/users/faethonm/repos","events_url":"https://api.github.com/users/faethonm/events{/privacy}","received_events_url":"https://api.github.com/users/faethonm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/faethonm/sviper","description":"Applications for svip ","fork":false,"url":"https://api.github.com/repos/faethonm/sviper","forks_url":"https://api.github.com/repos/faethonm/sviper/forks","keys_url":"https://api.github.com/repos/faethonm/sviper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/faethonm/sviper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/faethonm/sviper/teams","hooks_url":"https://api.github.com/repos/faethonm/sviper/hooks","issue_events_url":"https://api.github.com/repos/faethonm/sviper/issues/events{/number}","events_url":"https://api.github.com/repos/faethonm/sviper/events","assignees_url":"https://api.github.com/repos/faethonm/sviper/assignees{/user}","branches_url":"https://api.github.com/repos/faethonm/sviper/branches{/branch}","tags_url":"https://api.github.com/repos/faethonm/sviper/tags","blobs_url":"https://api.github.com/repos/faethonm/sviper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/faethonm/sviper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/faethonm/sviper/git/refs{/sha}","trees_url":"https://api.github.com/repos/faethonm/sviper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/faethonm/sviper/statuses/{sha}","languages_url":"https://api.github.com/repos/faethonm/sviper/languages","stargazers_url":"https://api.github.com/repos/faethonm/sviper/stargazers","contributors_url":"https://api.github.com/repos/faethonm/sviper/contributors","subscribers_url":"https://api.github.com/repos/faethonm/sviper/subscribers","subscription_url":"https://api.github.com/repos/faethonm/sviper/subscription","commits_url":"https://api.github.com/repos/faethonm/sviper/commits{/sha}","git_commits_url":"https://api.github.com/repos/faethonm/sviper/git/commits{/sha}","comments_url":"https://api.github.com/repos/faethonm/sviper/comments{/number}","issue_comment_url":"https://api.github.com/repos/faethonm/sviper/issues/comments{/number}","contents_url":"https://api.github.com/repos/faethonm/sviper/contents/{+path}","compare_url":"https://api.github.com/repos/faethonm/sviper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/faethonm/sviper/merges","archive_url":"https://api.github.com/repos/faethonm/sviper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/faethonm/sviper/downloads","issues_url":"https://api.github.com/repos/faethonm/sviper/issues{/number}","pulls_url":"https://api.github.com/repos/faethonm/sviper/pulls{/number}","milestones_url":"https://api.github.com/repos/faethonm/sviper/milestones{/number}","notifications_url":"https://api.github.com/repos/faethonm/sviper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/faethonm/sviper/labels{/name}","releases_url":"https://api.github.com/repos/faethonm/sviper/releases{/id}","deployments_url":"https://api.github.com/repos/faethonm/sviper/deployments","created_at":"2016-07-08T17:58:40Z","updated_at":"2016-07-12T18:39:50Z","pushed_at":"2016-07-18T09:23:29Z","git_url":"git://github.com/faethonm/sviper.git","ssh_url":"git@github.com:faethonm/sviper.git","clone_url":"https://github.com/faethonm/sviper.git","svn_url":"https://github.com/faethonm/sviper","homepage":null,"size":243,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"faethonm:master","ref":"master","sha":"e494ceb1b965ccaf50629d184bb59c82adc8bdc2","user":{"login":"faethonm","id":874412,"avatar_url":"https://avatars.githubusercontent.com/u/874412?v=3","gravatar_id":"","url":"https://api.github.com/users/faethonm","html_url":"https://github.com/faethonm","followers_url":"https://api.github.com/users/faethonm/followers","following_url":"https://api.github.com/users/faethonm/following{/other_user}","gists_url":"https://api.github.com/users/faethonm/gists{/gist_id}","starred_url":"https://api.github.com/users/faethonm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faethonm/subscriptions","organizations_url":"https://api.github.com/users/faethonm/orgs","repos_url":"https://api.github.com/users/faethonm/repos","events_url":"https://api.github.com/users/faethonm/events{/privacy}","received_events_url":"https://api.github.com/users/faethonm/received_events","type":"User","site_admin":false},"repo":{"id":62907286,"name":"sviper","full_name":"faethonm/sviper","owner":{"login":"faethonm","id":874412,"avatar_url":"https://avatars.githubusercontent.com/u/874412?v=3","gravatar_id":"","url":"https://api.github.com/users/faethonm","html_url":"https://github.com/faethonm","followers_url":"https://api.github.com/users/faethonm/followers","following_url":"https://api.github.com/users/faethonm/following{/other_user}","gists_url":"https://api.github.com/users/faethonm/gists{/gist_id}","starred_url":"https://api.github.com/users/faethonm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faethonm/subscriptions","organizations_url":"https://api.github.com/users/faethonm/orgs","repos_url":"https://api.github.com/users/faethonm/repos","events_url":"https://api.github.com/users/faethonm/events{/privacy}","received_events_url":"https://api.github.com/users/faethonm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/faethonm/sviper","description":"Applications for svip ","fork":false,"url":"https://api.github.com/repos/faethonm/sviper","forks_url":"https://api.github.com/repos/faethonm/sviper/forks","keys_url":"https://api.github.com/repos/faethonm/sviper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/faethonm/sviper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/faethonm/sviper/teams","hooks_url":"https://api.github.com/repos/faethonm/sviper/hooks","issue_events_url":"https://api.github.com/repos/faethonm/sviper/issues/events{/number}","events_url":"https://api.github.com/repos/faethonm/sviper/events","assignees_url":"https://api.github.com/repos/faethonm/sviper/assignees{/user}","branches_url":"https://api.github.com/repos/faethonm/sviper/branches{/branch}","tags_url":"https://api.github.com/repos/faethonm/sviper/tags","blobs_url":"https://api.github.com/repos/faethonm/sviper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/faethonm/sviper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/faethonm/sviper/git/refs{/sha}","trees_url":"https://api.github.com/repos/faethonm/sviper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/faethonm/sviper/statuses/{sha}","languages_url":"https://api.github.com/repos/faethonm/sviper/languages","stargazers_url":"https://api.github.com/repos/faethonm/sviper/stargazers","contributors_url":"https://api.github.com/repos/faethonm/sviper/contributors","subscribers_url":"https://api.github.com/repos/faethonm/sviper/subscribers","subscription_url":"https://api.github.com/repos/faethonm/sviper/subscription","commits_url":"https://api.github.com/repos/faethonm/sviper/commits{/sha}","git_commits_url":"https://api.github.com/repos/faethonm/sviper/git/commits{/sha}","comments_url":"https://api.github.com/repos/faethonm/sviper/comments{/number}","issue_comment_url":"https://api.github.com/repos/faethonm/sviper/issues/comments{/number}","contents_url":"https://api.github.com/repos/faethonm/sviper/contents/{+path}","compare_url":"https://api.github.com/repos/faethonm/sviper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/faethonm/sviper/merges","archive_url":"https://api.github.com/repos/faethonm/sviper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/faethonm/sviper/downloads","issues_url":"https://api.github.com/repos/faethonm/sviper/issues{/number}","pulls_url":"https://api.github.com/repos/faethonm/sviper/pulls{/number}","milestones_url":"https://api.github.com/repos/faethonm/sviper/milestones{/number}","notifications_url":"https://api.github.com/repos/faethonm/sviper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/faethonm/sviper/labels{/name}","releases_url":"https://api.github.com/repos/faethonm/sviper/releases{/id}","deployments_url":"https://api.github.com/repos/faethonm/sviper/deployments","created_at":"2016-07-08T17:58:40Z","updated_at":"2016-07-12T18:39:50Z","pushed_at":"2016-07-18T09:23:29Z","git_url":"git://github.com/faethonm/sviper.git","ssh_url":"git@github.com:faethonm/sviper.git","clone_url":"https://github.com/faethonm/sviper.git","svn_url":"https://github.com/faethonm/sviper","homepage":null,"size":243,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/faethonm/sviper/pulls/6"},"html":{"href":"https://github.com/faethonm/sviper/pull/6"},"issue":{"href":"https://api.github.com/repos/faethonm/sviper/issues/6"},"comments":{"href":"https://api.github.com/repos/faethonm/sviper/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/faethonm/sviper/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/faethonm/sviper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/faethonm/sviper/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/faethonm/sviper/statuses/02dd8a62106f2ccf8c46c92ff07a5d00c3368d78"}}}}
{"actor":{"display_login":"cionescu"}}