{"action":"opened","issue":{"url":"https://api.github.com/repos/dpn-admin/dpn-server/issues/143","repository_url":"https://api.github.com/repos/dpn-admin/dpn-server","labels_url":"https://api.github.com/repos/dpn-admin/dpn-server/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/dpn-admin/dpn-server/issues/143/comments","events_url":"https://api.github.com/repos/dpn-admin/dpn-server/issues/143/events","html_url":"https://github.com/dpn-admin/dpn-server/issues/143","id":193624850,"number":143,"title":"Duplicate ids raises RecordInvalid instead of RecordNotUnique","user":{"login":"malakai97","id":3486429,"avatar_url":"https://avatars.githubusercontent.com/u/3486429?v=3","gravatar_id":"","url":"https://api.github.com/users/malakai97","html_url":"https://github.com/malakai97","followers_url":"https://api.github.com/users/malakai97/followers","following_url":"https://api.github.com/users/malakai97/following{/other_user}","gists_url":"https://api.github.com/users/malakai97/gists{/gist_id}","starred_url":"https://api.github.com/users/malakai97/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malakai97/subscriptions","organizations_url":"https://api.github.com/users/malakai97/orgs","repos_url":"https://api.github.com/users/malakai97/repos","events_url":"https://api.github.com/users/malakai97/events{/privacy}","received_events_url":"https://api.github.com/users/malakai97/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-05T22:12:08Z","updated_at":"2016-12-05T22:12:08Z","closed_at":null,"body":"You can see this by creating a record with an <type>_id equal to one that already exists, regardless of other fields changing.\r\n\r\nThis is caused by the `uniqueness: true` validation, which causes the field's uniqueness to be validated before trying to save to the database.  Only the error originating in the database leads to a RecordNotUnique exception.\r\n\r\nThis validation is present on the <type>_id field of present on \r\n* Bag\r\n* FixityCheck \r\n* Ingest\r\n* Member\r\n* Node\r\n* ReplicationTransfer\r\n* RestoreTransfer\r\n* RunTime\r\n* VersionFamily\r\n\r\nAdditionally, there is a compound constraint on MessageDigest via `validates_uniqueness_of :bag, scope: :fixity_alg`.  \r\n\r\nNote that all of these constraints are already being enforced at the database level, should continue to be enforced there."}}
{"actor":{"display_login":"malakai97"}}