{"action":"created","comment":{"url":"https://api.github.com/repos/18F/identity-idp/pulls/comments/71238200","id":71238200,"diff_hunk":"@@ -0,0 +1,43 @@\n+require 'rails_helper'\n+\n+describe Profile do\n+  let(:user) { create(:user, :signed_up) }\n+  let(:profile) do\n+    Profile.create(\n+      user_id: user.id\n+    )\n+  end\n+\n+  subject { profile }\n+\n+  it { is_expected.to belong_to(:user) }\n+\n+  describe 'allows only one active Profile per user' do\n+    it 'prevents create! via ActiveRecord uniqueness validation' do\n+      profile.active = true\n+      profile.save!\n+      expect do\n+        Profile.create!(user_id: user.id, active: true)\n+      end.to raise_error(ActiveRecord::RecordInvalid)\n+    end\n+\n+    it 'prevents save! via psql unique partial index' do\n+      profile.active = true","path":"spec/models/profile_spec.rb","position":25,"original_position":25,"commit_id":"34e424763c13073ba0546de4858bb7b24c705905","original_commit_id":"f9e1a9c007afd63ecf26408b8c5b57122dcb7268","user":{"login":"sbc100","id":515813,"avatar_url":"https://avatars.githubusercontent.com/u/515813?v=3","gravatar_id":"","url":"https://api.github.com/users/sbc100","html_url":"https://github.com/sbc100","followers_url":"https://api.github.com/users/sbc100/followers","following_url":"https://api.github.com/users/sbc100/following{/other_user}","gists_url":"https://api.github.com/users/sbc100/gists{/gist_id}","starred_url":"https://api.github.com/users/sbc100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbc100/subscriptions","organizations_url":"https://api.github.com/users/sbc100/orgs","repos_url":"https://api.github.com/users/sbc100/repos","events_url":"https://api.github.com/users/sbc100/events{/privacy}","received_events_url":"https://api.github.com/users/sbc100/received_events","type":"User","site_admin":false},"body":"So when `save()` fails you can't find out why?  ","created_at":"2016-07-18T21:56:34Z","updated_at":"2016-07-18T21:56:34Z","html_url":"https://github.com/18F/identity-idp/pull/277#discussion_r71238200","pull_request_url":"https://api.github.com/repos/18F/identity-idp/pulls/277","_links":{"self":{"href":"https://api.github.com/repos/18F/identity-idp/pulls/comments/71238200"},"html":{"href":"https://github.com/18F/identity-idp/pull/277#discussion_r71238200"},"pull_request":{"href":"https://api.github.com/repos/18F/identity-idp/pulls/277"}}},"pull_request":{"url":"https://api.github.com/repos/18F/identity-idp/pulls/277","id":77852807,"html_url":"https://github.com/18F/identity-idp/pull/277","diff_url":"https://github.com/18F/identity-idp/pull/277.diff","patch_url":"https://github.com/18F/identity-idp/pull/277.patch","issue_url":"https://api.github.com/repos/18F/identity-idp/issues/277","number":277,"state":"open","locked":false,"title":"Store PII on its own table","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":"**Why**:\r\n\r\nWe collect PII for 2 reasons:\r\n\r\n* identity resolution in proofing process,\r\n* pass verified values to relying parties as required.\r\n\r\n**How**:\r\n\r\nPer https://github.com/18F/identity-private/issues/479\r\nPII is stored on its own table, with a one-to-many relationship\r\nto users table. The 'active' and 'verified' flags are tracked\r\nin order to indicate the status of each profile record.","created_at":"2016-07-18T18:13:47Z","updated_at":"2016-07-18T21:56:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a3e366bb3f8b8fbc38b6f809beb47beeeaf121f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/18F/identity-idp/pulls/277/commits","review_comments_url":"https://api.github.com/repos/18F/identity-idp/pulls/277/comments","review_comment_url":"https://api.github.com/repos/18F/identity-idp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/18F/identity-idp/issues/277/comments","statuses_url":"https://api.github.com/repos/18F/identity-idp/statuses/34e424763c13073ba0546de4858bb7b24c705905","head":{"label":"18F:pii-storage","ref":"pii-storage","sha":"34e424763c13073ba0546de4858bb7b24c705905","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":50386243,"name":"identity-idp","full_name":"18F/identity-idp","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/identity-idp","description":"18f PoC Identity Provider (IdP)","fork":false,"url":"https://api.github.com/repos/18F/identity-idp","forks_url":"https://api.github.com/repos/18F/identity-idp/forks","keys_url":"https://api.github.com/repos/18F/identity-idp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/identity-idp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/identity-idp/teams","hooks_url":"https://api.github.com/repos/18F/identity-idp/hooks","issue_events_url":"https://api.github.com/repos/18F/identity-idp/issues/events{/number}","events_url":"https://api.github.com/repos/18F/identity-idp/events","assignees_url":"https://api.github.com/repos/18F/identity-idp/assignees{/user}","branches_url":"https://api.github.com/repos/18F/identity-idp/branches{/branch}","tags_url":"https://api.github.com/repos/18F/identity-idp/tags","blobs_url":"https://api.github.com/repos/18F/identity-idp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/identity-idp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/identity-idp/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/identity-idp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/identity-idp/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/identity-idp/languages","stargazers_url":"https://api.github.com/repos/18F/identity-idp/stargazers","contributors_url":"https://api.github.com/repos/18F/identity-idp/contributors","subscribers_url":"https://api.github.com/repos/18F/identity-idp/subscribers","subscription_url":"https://api.github.com/repos/18F/identity-idp/subscription","commits_url":"https://api.github.com/repos/18F/identity-idp/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/identity-idp/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/identity-idp/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/identity-idp/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/identity-idp/contents/{+path}","compare_url":"https://api.github.com/repos/18F/identity-idp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/identity-idp/merges","archive_url":"https://api.github.com/repos/18F/identity-idp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/identity-idp/downloads","issues_url":"https://api.github.com/repos/18F/identity-idp/issues{/number}","pulls_url":"https://api.github.com/repos/18F/identity-idp/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/identity-idp/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/identity-idp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/identity-idp/labels{/name}","releases_url":"https://api.github.com/repos/18F/identity-idp/releases{/id}","deployments_url":"https://api.github.com/repos/18F/identity-idp/deployments","created_at":"2016-01-25T22:40:59Z","updated_at":"2016-07-02T05:06:51Z","pushed_at":"2016-07-18T21:55:54Z","git_url":"git://github.com/18F/identity-idp.git","ssh_url":"git@github.com:18F/identity-idp.git","clone_url":"https://github.com/18F/identity-idp.git","svn_url":"https://github.com/18F/identity-idp","homepage":"https://upaya-idp-dev.18f.gov/","size":7365,"stargazers_count":15,"watchers_count":15,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":5,"forks":3,"open_issues":5,"watchers":15,"default_branch":"master"}},"base":{"label":"18F:master","ref":"master","sha":"ca5204c38b04253b66dcd125d3611e9d27689d1d","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":50386243,"name":"identity-idp","full_name":"18F/identity-idp","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/identity-idp","description":"18f PoC Identity Provider (IdP)","fork":false,"url":"https://api.github.com/repos/18F/identity-idp","forks_url":"https://api.github.com/repos/18F/identity-idp/forks","keys_url":"https://api.github.com/repos/18F/identity-idp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/identity-idp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/identity-idp/teams","hooks_url":"https://api.github.com/repos/18F/identity-idp/hooks","issue_events_url":"https://api.github.com/repos/18F/identity-idp/issues/events{/number}","events_url":"https://api.github.com/repos/18F/identity-idp/events","assignees_url":"https://api.github.com/repos/18F/identity-idp/assignees{/user}","branches_url":"https://api.github.com/repos/18F/identity-idp/branches{/branch}","tags_url":"https://api.github.com/repos/18F/identity-idp/tags","blobs_url":"https://api.github.com/repos/18F/identity-idp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/identity-idp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/identity-idp/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/identity-idp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/identity-idp/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/identity-idp/languages","stargazers_url":"https://api.github.com/repos/18F/identity-idp/stargazers","contributors_url":"https://api.github.com/repos/18F/identity-idp/contributors","subscribers_url":"https://api.github.com/repos/18F/identity-idp/subscribers","subscription_url":"https://api.github.com/repos/18F/identity-idp/subscription","commits_url":"https://api.github.com/repos/18F/identity-idp/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/identity-idp/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/identity-idp/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/identity-idp/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/identity-idp/contents/{+path}","compare_url":"https://api.github.com/repos/18F/identity-idp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/identity-idp/merges","archive_url":"https://api.github.com/repos/18F/identity-idp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/identity-idp/downloads","issues_url":"https://api.github.com/repos/18F/identity-idp/issues{/number}","pulls_url":"https://api.github.com/repos/18F/identity-idp/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/identity-idp/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/identity-idp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/identity-idp/labels{/name}","releases_url":"https://api.github.com/repos/18F/identity-idp/releases{/id}","deployments_url":"https://api.github.com/repos/18F/identity-idp/deployments","created_at":"2016-01-25T22:40:59Z","updated_at":"2016-07-02T05:06:51Z","pushed_at":"2016-07-18T21:55:54Z","git_url":"git://github.com/18F/identity-idp.git","ssh_url":"git@github.com:18F/identity-idp.git","clone_url":"https://github.com/18F/identity-idp.git","svn_url":"https://github.com/18F/identity-idp","homepage":"https://upaya-idp-dev.18f.gov/","size":7365,"stargazers_count":15,"watchers_count":15,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":5,"forks":3,"open_issues":5,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/identity-idp/pulls/277"},"html":{"href":"https://github.com/18F/identity-idp/pull/277"},"issue":{"href":"https://api.github.com/repos/18F/identity-idp/issues/277"},"comments":{"href":"https://api.github.com/repos/18F/identity-idp/issues/277/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/identity-idp/pulls/277/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/identity-idp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/18F/identity-idp/pulls/277/commits"},"statuses":{"href":"https://api.github.com/repos/18F/identity-idp/statuses/34e424763c13073ba0546de4858bb7b24c705905"}}}}
{"actor":{"display_login":"sbc100"}}