{"action":"created","comment":{"url":"https://api.github.com/repos/18F/C2/pulls/comments/41897601","id":41897601,"diff_hunk":"@@ -121,13 +121,23 @@ def approving_official\n       self.approvers.first\n     end\n \n-    def current_approver_email_address\n-      if self.pending?\n-        self.currently_awaiting_approvers.first.email_address\n-      elsif self.approving_official\n-        self.approving_official.email_address\n+    def current_approver\n+      if pending?\n+        currently_awaiting_approvers.first\n+      elsif approving_official\n+        approving_official\n+      elsif emergency and approvers.empty?\n+        nil\n       else\n-        self.system_approver_emails.first\n+        User.for_email(self.system_approver_emails.first)\n+      end\n+    end\n+\n+    def final_approver\n+      if !emergency and approvers.any?\n+        approvers.last\n+      else","path":"app/models/ncr/work_order.rb","position":25,"original_position":25,"commit_id":"fa502e5ed597b9f98fe642807e90553dc757ffe5","original_commit_id":"fa502e5ed597b9f98fe642807e90553dc757ffe5","user":{"login":"jessieay","id":601515,"avatar_url":"https://avatars.githubusercontent.com/u/601515?v=3","gravatar_id":"","url":"https://api.github.com/users/jessieay","html_url":"https://github.com/jessieay","followers_url":"https://api.github.com/users/jessieay/followers","following_url":"https://api.github.com/users/jessieay/following{/other_user}","gists_url":"https://api.github.com/users/jessieay/gists{/gist_id}","starred_url":"https://api.github.com/users/jessieay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessieay/subscriptions","organizations_url":"https://api.github.com/users/jessieay/orgs","repos_url":"https://api.github.com/users/jessieay/repos","events_url":"https://api.github.com/users/jessieay/events{/privacy}","received_events_url":"https://api.github.com/users/jessieay/received_events","type":"User","site_admin":false},"body":"don't need this `else` -- I know we discussed this in a previous PR with @afeld but it seems to be that if we want to always do an `else nil` on a conditional in Ruby (which is the behavior whether you do it explicitly or not) then we should do it everywhere and not just selectively. I would vote not to do it.","created_at":"2015-10-13T17:29:34Z","updated_at":"2015-10-13T17:29:34Z","html_url":"https://github.com/18F/C2/pull/681#discussion_r41897601","pull_request_url":"https://api.github.com/repos/18F/C2/pulls/681","_links":{"self":{"href":"https://api.github.com/repos/18F/C2/pulls/comments/41897601"},"html":{"href":"https://github.com/18F/C2/pull/681#discussion_r41897601"},"pull_request":{"href":"https://api.github.com/repos/18F/C2/pulls/681"}}},"pull_request":{"url":"https://api.github.com/repos/18F/C2/pulls/681","id":46980635,"html_url":"https://github.com/18F/C2/pull/681","diff_url":"https://github.com/18F/C2/pull/681.diff","patch_url":"https://github.com/18F/C2/pull/681.patch","issue_url":"https://api.github.com/repos/18F/C2/issues/681","number":681,"state":"open","locked":false,"title":"[Delivers #104981410] consistent approving official email in report","user":{"login":"pkarman","id":1205061,"avatar_url":"https://avatars.githubusercontent.com/u/1205061?v=3","gravatar_id":"","url":"https://api.github.com/users/pkarman","html_url":"https://github.com/pkarman","followers_url":"https://api.github.com/users/pkarman/followers","following_url":"https://api.github.com/users/pkarman/following{/other_user}","gists_url":"https://api.github.com/users/pkarman/gists{/gist_id}","starred_url":"https://api.github.com/users/pkarman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkarman/subscriptions","organizations_url":"https://api.github.com/users/pkarman/orgs","repos_url":"https://api.github.com/users/pkarman/repos","events_url":"https://api.github.com/users/pkarman/events{/privacy}","received_events_url":"https://api.github.com/users/pkarman/received_events","type":"User","site_admin":false},"body":"use same method everywhere for reporting the approving official for NCR work orders. \r\nNOTE the biz rule here is in question and this PR is mostly to prompt a conversation.","created_at":"2015-10-07T02:18:58Z","updated_at":"2015-10-13T17:29:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"925957a0b2e5fbc0912754092596875b35ae7915","assignee":{"login":"afeld","id":86842,"avatar_url":"https://avatars.githubusercontent.com/u/86842?v=3","gravatar_id":"","url":"https://api.github.com/users/afeld","html_url":"https://github.com/afeld","followers_url":"https://api.github.com/users/afeld/followers","following_url":"https://api.github.com/users/afeld/following{/other_user}","gists_url":"https://api.github.com/users/afeld/gists{/gist_id}","starred_url":"https://api.github.com/users/afeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afeld/subscriptions","organizations_url":"https://api.github.com/users/afeld/orgs","repos_url":"https://api.github.com/users/afeld/repos","events_url":"https://api.github.com/users/afeld/events{/privacy}","received_events_url":"https://api.github.com/users/afeld/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/18F/C2/pulls/681/commits","review_comments_url":"https://api.github.com/repos/18F/C2/pulls/681/comments","review_comment_url":"https://api.github.com/repos/18F/C2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/18F/C2/issues/681/comments","statuses_url":"https://api.github.com/repos/18F/C2/statuses/fa502e5ed597b9f98fe642807e90553dc757ffe5","head":{"label":"18F:104981410-consistent-approver-email-address","ref":"104981410-consistent-approver-email-address","sha":"fa502e5ed597b9f98fe642807e90553dc757ffe5","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":18201810,"name":"C2","full_name":"18F/C2","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/C2","description":"an approval process automation tool","fork":false,"url":"https://api.github.com/repos/18F/C2","forks_url":"https://api.github.com/repos/18F/C2/forks","keys_url":"https://api.github.com/repos/18F/C2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/C2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/C2/teams","hooks_url":"https://api.github.com/repos/18F/C2/hooks","issue_events_url":"https://api.github.com/repos/18F/C2/issues/events{/number}","events_url":"https://api.github.com/repos/18F/C2/events","assignees_url":"https://api.github.com/repos/18F/C2/assignees{/user}","branches_url":"https://api.github.com/repos/18F/C2/branches{/branch}","tags_url":"https://api.github.com/repos/18F/C2/tags","blobs_url":"https://api.github.com/repos/18F/C2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/C2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/C2/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/C2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/C2/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/C2/languages","stargazers_url":"https://api.github.com/repos/18F/C2/stargazers","contributors_url":"https://api.github.com/repos/18F/C2/contributors","subscribers_url":"https://api.github.com/repos/18F/C2/subscribers","subscription_url":"https://api.github.com/repos/18F/C2/subscription","commits_url":"https://api.github.com/repos/18F/C2/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/C2/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/C2/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/C2/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/C2/contents/{+path}","compare_url":"https://api.github.com/repos/18F/C2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/C2/merges","archive_url":"https://api.github.com/repos/18F/C2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/C2/downloads","issues_url":"https://api.github.com/repos/18F/C2/issues{/number}","pulls_url":"https://api.github.com/repos/18F/C2/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/C2/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/C2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/C2/labels{/name}","releases_url":"https://api.github.com/repos/18F/C2/releases{/id}","created_at":"2014-03-28T05:15:23Z","updated_at":"2015-10-09T18:26:20Z","pushed_at":"2015-10-13T17:16:46Z","git_url":"git://github.com/18F/C2.git","ssh_url":"git@github.com:18F/C2.git","clone_url":"https://github.com/18F/C2.git","svn_url":"https://github.com/18F/C2","homepage":"https://cap.18f.gov","size":86640,"stargazers_count":25,"watchers_count":25,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":33,"forks":14,"open_issues":33,"watchers":25,"default_branch":"master"}},"base":{"label":"18F:master","ref":"master","sha":"b25faa52f4c75b8d1e56127251a805ea38e055f0","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":18201810,"name":"C2","full_name":"18F/C2","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/C2","description":"an approval process automation tool","fork":false,"url":"https://api.github.com/repos/18F/C2","forks_url":"https://api.github.com/repos/18F/C2/forks","keys_url":"https://api.github.com/repos/18F/C2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/C2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/C2/teams","hooks_url":"https://api.github.com/repos/18F/C2/hooks","issue_events_url":"https://api.github.com/repos/18F/C2/issues/events{/number}","events_url":"https://api.github.com/repos/18F/C2/events","assignees_url":"https://api.github.com/repos/18F/C2/assignees{/user}","branches_url":"https://api.github.com/repos/18F/C2/branches{/branch}","tags_url":"https://api.github.com/repos/18F/C2/tags","blobs_url":"https://api.github.com/repos/18F/C2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/C2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/C2/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/C2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/C2/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/C2/languages","stargazers_url":"https://api.github.com/repos/18F/C2/stargazers","contributors_url":"https://api.github.com/repos/18F/C2/contributors","subscribers_url":"https://api.github.com/repos/18F/C2/subscribers","subscription_url":"https://api.github.com/repos/18F/C2/subscription","commits_url":"https://api.github.com/repos/18F/C2/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/C2/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/C2/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/C2/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/C2/contents/{+path}","compare_url":"https://api.github.com/repos/18F/C2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/C2/merges","archive_url":"https://api.github.com/repos/18F/C2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/C2/downloads","issues_url":"https://api.github.com/repos/18F/C2/issues{/number}","pulls_url":"https://api.github.com/repos/18F/C2/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/C2/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/C2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/C2/labels{/name}","releases_url":"https://api.github.com/repos/18F/C2/releases{/id}","created_at":"2014-03-28T05:15:23Z","updated_at":"2015-10-09T18:26:20Z","pushed_at":"2015-10-13T17:16:46Z","git_url":"git://github.com/18F/C2.git","ssh_url":"git@github.com:18F/C2.git","clone_url":"https://github.com/18F/C2.git","svn_url":"https://github.com/18F/C2","homepage":"https://cap.18f.gov","size":86640,"stargazers_count":25,"watchers_count":25,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":33,"forks":14,"open_issues":33,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/C2/pulls/681"},"html":{"href":"https://github.com/18F/C2/pull/681"},"issue":{"href":"https://api.github.com/repos/18F/C2/issues/681"},"comments":{"href":"https://api.github.com/repos/18F/C2/issues/681/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/C2/pulls/681/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/C2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/18F/C2/pulls/681/commits"},"statuses":{"href":"https://api.github.com/repos/18F/C2/statuses/fa502e5ed597b9f98fe642807e90553dc757ffe5"}}}}