{"action":"created","comment":{"url":"https://api.github.com/repos/sparc-request/sparc-request/pulls/comments/76274059","id":76274059,"diff_hunk":"@@ -269,32 +276,20 @@ def validate_proxy_rights\n     errors.add(:base, \"All users must be assigned a proxy right\") unless self.project_roles.map(&:project_rights).find_all(&:nil?).empty?\n   end\n \n-  def principal_investigators\n-    project_roles.reject{|pr| !['pi', 'primary-pi'].include?(pr.role)}.map(&:identity)\n-  end\n-\n   def primary_principal_investigator\n     primary_pi_project_role.try(:identity)\n   end\n \n   def primary_pi_project_role\n-    project_roles.detect { |pr| pr.role == 'primary-pi' }\n-  end\n-\n-  def billing_managers\n-    project_roles.reject{|pr| pr.role != 'business-grants-manager'}.map(&:identity)\n+    project_roles.find_by(role: 'primary-pi')\n   end\n \n   def billing_business_manager_email\n     billing_business_manager_static_email.blank? ?  billing_managers.map(&:email).try(:join, ', ') : billing_business_manager_static_email\n   end\n \n-  def coordinators\n-    project_roles.select{|pr| pr.role == 'research-assistant-coordinator'}.map(&:identity)\n-  end\n-\n   def coordinator_emails\n-    coordinators.map(&:email).try(:join, ', ')\n+    coordinators.pluck(:email).try(:join, ', ')","path":"app/models/protocol.rb","position":45,"original_position":45,"commit_id":"3d0cf44fc72b8fd33d4c78ac191167994e3d7707","original_commit_id":"3d0cf44fc72b8fd33d4c78ac191167994e3d7707","user":{"login":"jayhardee9","id":6964208,"avatar_url":"https://avatars.githubusercontent.com/u/6964208?v=3","gravatar_id":"","url":"https://api.github.com/users/jayhardee9","html_url":"https://github.com/jayhardee9","followers_url":"https://api.github.com/users/jayhardee9/followers","following_url":"https://api.github.com/users/jayhardee9/following{/other_user}","gists_url":"https://api.github.com/users/jayhardee9/gists{/gist_id}","starred_url":"https://api.github.com/users/jayhardee9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayhardee9/subscriptions","organizations_url":"https://api.github.com/users/jayhardee9/orgs","repos_url":"https://api.github.com/users/jayhardee9/repos","events_url":"https://api.github.com/users/jayhardee9/events{/privacy}","received_events_url":"https://api.github.com/users/jayhardee9/received_events","type":"User","site_admin":false},"body":"I think you're right.","created_at":"2016-08-25T16:09:15Z","updated_at":"2016-08-25T16:09:15Z","html_url":"https://github.com/sparc-request/sparc-request/pull/648#discussion_r76274059","pull_request_url":"https://api.github.com/repos/sparc-request/sparc-request/pulls/648","_links":{"self":{"href":"https://api.github.com/repos/sparc-request/sparc-request/pulls/comments/76274059"},"html":{"href":"https://github.com/sparc-request/sparc-request/pull/648#discussion_r76274059"},"pull_request":{"href":"https://api.github.com/repos/sparc-request/sparc-request/pulls/648"}}},"pull_request":{"url":"https://api.github.com/repos/sparc-request/sparc-request/pulls/648","id":82348341,"html_url":"https://github.com/sparc-request/sparc-request/pull/648","diff_url":"https://github.com/sparc-request/sparc-request/pull/648.diff","patch_url":"https://github.com/sparc-request/sparc-request/pull/648.patch","issue_url":"https://api.github.com/repos/sparc-request/sparc-request/issues/648","number":648,"state":"open","locked":false,"title":"Jjh protocol model refactor","user":{"login":"jayhardee9","id":6964208,"avatar_url":"https://avatars.githubusercontent.com/u/6964208?v=3","gravatar_id":"","url":"https://api.github.com/users/jayhardee9","html_url":"https://github.com/jayhardee9","followers_url":"https://api.github.com/users/jayhardee9/followers","following_url":"https://api.github.com/users/jayhardee9/following{/other_user}","gists_url":"https://api.github.com/users/jayhardee9/gists{/gist_id}","starred_url":"https://api.github.com/users/jayhardee9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayhardee9/subscriptions","organizations_url":"https://api.github.com/users/jayhardee9/orgs","repos_url":"https://api.github.com/users/jayhardee9/repos","events_url":"https://api.github.com/users/jayhardee9/events{/privacy}","received_events_url":"https://api.github.com/users/jayhardee9/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-23T11:34:47Z","updated_at":"2016-08-25T16:09:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7380e5cb63a1f3304fed7081a7703244f8eb66a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sparc-request/sparc-request/pulls/648/commits","review_comments_url":"https://api.github.com/repos/sparc-request/sparc-request/pulls/648/comments","review_comment_url":"https://api.github.com/repos/sparc-request/sparc-request/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sparc-request/sparc-request/issues/648/comments","statuses_url":"https://api.github.com/repos/sparc-request/sparc-request/statuses/3d0cf44fc72b8fd33d4c78ac191167994e3d7707","head":{"label":"sparc-request:jjh-protocol-model-refactor","ref":"jjh-protocol-model-refactor","sha":"3d0cf44fc72b8fd33d4c78ac191167994e3d7707","user":{"login":"sparc-request","id":8311757,"avatar_url":"https://avatars.githubusercontent.com/u/8311757?v=3","gravatar_id":"","url":"https://api.github.com/users/sparc-request","html_url":"https://github.com/sparc-request","followers_url":"https://api.github.com/users/sparc-request/followers","following_url":"https://api.github.com/users/sparc-request/following{/other_user}","gists_url":"https://api.github.com/users/sparc-request/gists{/gist_id}","starred_url":"https://api.github.com/users/sparc-request/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sparc-request/subscriptions","organizations_url":"https://api.github.com/users/sparc-request/orgs","repos_url":"https://api.github.com/users/sparc-request/repos","events_url":"https://api.github.com/users/sparc-request/events{/privacy}","received_events_url":"https://api.github.com/users/sparc-request/received_events","type":"User","site_admin":false},"repo":{"id":22610009,"name":"sparc-request","full_name":"sparc-request/sparc-request","owner":{"login":"sparc-request","id":8311757,"avatar_url":"https://avatars.githubusercontent.com/u/8311757?v=3","gravatar_id":"","url":"https://api.github.com/users/sparc-request","html_url":"https://github.com/sparc-request","followers_url":"https://api.github.com/users/sparc-request/followers","following_url":"https://api.github.com/users/sparc-request/following{/other_user}","gists_url":"https://api.github.com/users/sparc-request/gists{/gist_id}","starred_url":"https://api.github.com/users/sparc-request/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sparc-request/subscriptions","organizations_url":"https://api.github.com/users/sparc-request/orgs","repos_url":"https://api.github.com/users/sparc-request/repos","events_url":"https://api.github.com/users/sparc-request/events{/privacy}","received_events_url":"https://api.github.com/users/sparc-request/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sparc-request/sparc-request","description":"","fork":false,"url":"https://api.github.com/repos/sparc-request/sparc-request","forks_url":"https://api.github.com/repos/sparc-request/sparc-request/forks","keys_url":"https://api.github.com/repos/sparc-request/sparc-request/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sparc-request/sparc-request/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sparc-request/sparc-request/teams","hooks_url":"https://api.github.com/repos/sparc-request/sparc-request/hooks","issue_events_url":"https://api.github.com/repos/sparc-request/sparc-request/issues/events{/number}","events_url":"https://api.github.com/repos/sparc-request/sparc-request/events","assignees_url":"https://api.github.com/repos/sparc-request/sparc-request/assignees{/user}","branches_url":"https://api.github.com/repos/sparc-request/sparc-request/branches{/branch}","tags_url":"https://api.github.com/repos/sparc-request/sparc-request/tags","blobs_url":"https://api.github.com/repos/sparc-request/sparc-request/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sparc-request/sparc-request/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sparc-request/sparc-request/git/refs{/sha}","trees_url":"https://api.github.com/repos/sparc-request/sparc-request/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sparc-request/sparc-request/statuses/{sha}","languages_url":"https://api.github.com/repos/sparc-request/sparc-request/languages","stargazers_url":"https://api.github.com/repos/sparc-request/sparc-request/stargazers","contributors_url":"https://api.github.com/repos/sparc-request/sparc-request/contributors","subscribers_url":"https://api.github.com/repos/sparc-request/sparc-request/subscribers","subscription_url":"https://api.github.com/repos/sparc-request/sparc-request/subscription","commits_url":"https://api.github.com/repos/sparc-request/sparc-request/commits{/sha}","git_commits_url":"https://api.github.com/repos/sparc-request/sparc-request/git/commits{/sha}","comments_url":"https://api.github.com/repos/sparc-request/sparc-request/comments{/number}","issue_comment_url":"https://api.github.com/repos/sparc-request/sparc-request/issues/comments{/number}","contents_url":"https://api.github.com/repos/sparc-request/sparc-request/contents/{+path}","compare_url":"https://api.github.com/repos/sparc-request/sparc-request/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sparc-request/sparc-request/merges","archive_url":"https://api.github.com/repos/sparc-request/sparc-request/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sparc-request/sparc-request/downloads","issues_url":"https://api.github.com/repos/sparc-request/sparc-request/issues{/number}","pulls_url":"https://api.github.com/repos/sparc-request/sparc-request/pulls{/number}","milestones_url":"https://api.github.com/repos/sparc-request/sparc-request/milestones{/number}","notifications_url":"https://api.github.com/repos/sparc-request/sparc-request/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sparc-request/sparc-request/labels{/name}","releases_url":"https://api.github.com/repos/sparc-request/sparc-request/releases{/id}","deployments_url":"https://api.github.com/repos/sparc-request/sparc-request/deployments","created_at":"2014-08-04T15:47:11Z","updated_at":"2016-07-22T19:17:55Z","pushed_at":"2016-08-25T16:06:21Z","git_url":"git://github.com/sparc-request/sparc-request.git","ssh_url":"git@github.com:sparc-request/sparc-request.git","clone_url":"https://github.com/sparc-request/sparc-request.git","svn_url":"https://github.com/sparc-request/sparc-request","homepage":null,"size":23994,"stargazers_count":7,"watchers_count":7,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":20,"forks":15,"open_issues":20,"watchers":7,"default_branch":"master"}},"base":{"label":"sparc-request:master","ref":"master","sha":"4b2536ccb98ed0cf48dac216b9bd61b6ccbcf51a","user":{"login":"sparc-request","id":8311757,"avatar_url":"https://avatars.githubusercontent.com/u/8311757?v=3","gravatar_id":"","url":"https://api.github.com/users/sparc-request","html_url":"https://github.com/sparc-request","followers_url":"https://api.github.com/users/sparc-request/followers","following_url":"https://api.github.com/users/sparc-request/following{/other_user}","gists_url":"https://api.github.com/users/sparc-request/gists{/gist_id}","starred_url":"https://api.github.com/users/sparc-request/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sparc-request/subscriptions","organizations_url":"https://api.github.com/users/sparc-request/orgs","repos_url":"https://api.github.com/users/sparc-request/repos","events_url":"https://api.github.com/users/sparc-request/events{/privacy}","received_events_url":"https://api.github.com/users/sparc-request/received_events","type":"User","site_admin":false},"repo":{"id":22610009,"name":"sparc-request","full_name":"sparc-request/sparc-request","owner":{"login":"sparc-request","id":8311757,"avatar_url":"https://avatars.githubusercontent.com/u/8311757?v=3","gravatar_id":"","url":"https://api.github.com/users/sparc-request","html_url":"https://github.com/sparc-request","followers_url":"https://api.github.com/users/sparc-request/followers","following_url":"https://api.github.com/users/sparc-request/following{/other_user}","gists_url":"https://api.github.com/users/sparc-request/gists{/gist_id}","starred_url":"https://api.github.com/users/sparc-request/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sparc-request/subscriptions","organizations_url":"https://api.github.com/users/sparc-request/orgs","repos_url":"https://api.github.com/users/sparc-request/repos","events_url":"https://api.github.com/users/sparc-request/events{/privacy}","received_events_url":"https://api.github.com/users/sparc-request/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sparc-request/sparc-request","description":"","fork":false,"url":"https://api.github.com/repos/sparc-request/sparc-request","forks_url":"https://api.github.com/repos/sparc-request/sparc-request/forks","keys_url":"https://api.github.com/repos/sparc-request/sparc-request/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sparc-request/sparc-request/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sparc-request/sparc-request/teams","hooks_url":"https://api.github.com/repos/sparc-request/sparc-request/hooks","issue_events_url":"https://api.github.com/repos/sparc-request/sparc-request/issues/events{/number}","events_url":"https://api.github.com/repos/sparc-request/sparc-request/events","assignees_url":"https://api.github.com/repos/sparc-request/sparc-request/assignees{/user}","branches_url":"https://api.github.com/repos/sparc-request/sparc-request/branches{/branch}","tags_url":"https://api.github.com/repos/sparc-request/sparc-request/tags","blobs_url":"https://api.github.com/repos/sparc-request/sparc-request/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sparc-request/sparc-request/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sparc-request/sparc-request/git/refs{/sha}","trees_url":"https://api.github.com/repos/sparc-request/sparc-request/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sparc-request/sparc-request/statuses/{sha}","languages_url":"https://api.github.com/repos/sparc-request/sparc-request/languages","stargazers_url":"https://api.github.com/repos/sparc-request/sparc-request/stargazers","contributors_url":"https://api.github.com/repos/sparc-request/sparc-request/contributors","subscribers_url":"https://api.github.com/repos/sparc-request/sparc-request/subscribers","subscription_url":"https://api.github.com/repos/sparc-request/sparc-request/subscription","commits_url":"https://api.github.com/repos/sparc-request/sparc-request/commits{/sha}","git_commits_url":"https://api.github.com/repos/sparc-request/sparc-request/git/commits{/sha}","comments_url":"https://api.github.com/repos/sparc-request/sparc-request/comments{/number}","issue_comment_url":"https://api.github.com/repos/sparc-request/sparc-request/issues/comments{/number}","contents_url":"https://api.github.com/repos/sparc-request/sparc-request/contents/{+path}","compare_url":"https://api.github.com/repos/sparc-request/sparc-request/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sparc-request/sparc-request/merges","archive_url":"https://api.github.com/repos/sparc-request/sparc-request/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sparc-request/sparc-request/downloads","issues_url":"https://api.github.com/repos/sparc-request/sparc-request/issues{/number}","pulls_url":"https://api.github.com/repos/sparc-request/sparc-request/pulls{/number}","milestones_url":"https://api.github.com/repos/sparc-request/sparc-request/milestones{/number}","notifications_url":"https://api.github.com/repos/sparc-request/sparc-request/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sparc-request/sparc-request/labels{/name}","releases_url":"https://api.github.com/repos/sparc-request/sparc-request/releases{/id}","deployments_url":"https://api.github.com/repos/sparc-request/sparc-request/deployments","created_at":"2014-08-04T15:47:11Z","updated_at":"2016-07-22T19:17:55Z","pushed_at":"2016-08-25T16:06:21Z","git_url":"git://github.com/sparc-request/sparc-request.git","ssh_url":"git@github.com:sparc-request/sparc-request.git","clone_url":"https://github.com/sparc-request/sparc-request.git","svn_url":"https://github.com/sparc-request/sparc-request","homepage":null,"size":23994,"stargazers_count":7,"watchers_count":7,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":20,"forks":15,"open_issues":20,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sparc-request/sparc-request/pulls/648"},"html":{"href":"https://github.com/sparc-request/sparc-request/pull/648"},"issue":{"href":"https://api.github.com/repos/sparc-request/sparc-request/issues/648"},"comments":{"href":"https://api.github.com/repos/sparc-request/sparc-request/issues/648/comments"},"review_comments":{"href":"https://api.github.com/repos/sparc-request/sparc-request/pulls/648/comments"},"review_comment":{"href":"https://api.github.com/repos/sparc-request/sparc-request/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sparc-request/sparc-request/pulls/648/commits"},"statuses":{"href":"https://api.github.com/repos/sparc-request/sparc-request/statuses/3d0cf44fc72b8fd33d4c78ac191167994e3d7707"}}}}
{"actor":{"display_login":"jayhardee9"}}