{"action":"closed","issue":{"url":"https://api.github.com/repos/nviennot/nobrainer/issues/139","labels_url":"https://api.github.com/repos/nviennot/nobrainer/issues/139/labels{/name}","comments_url":"https://api.github.com/repos/nviennot/nobrainer/issues/139/comments","events_url":"https://api.github.com/repos/nviennot/nobrainer/issues/139/events","html_url":"https://github.com/nviennot/nobrainer/issues/139","id":72489881,"number":139,"title":"NoBrainer::Error::DocumentNotPersisted - Duplicate primary key","user":{"login":"MadBomber","id":21101,"avatar_url":"https://avatars.githubusercontent.com/u/21101?v=3","gravatar_id":"","url":"https://api.github.com/users/MadBomber","html_url":"https://github.com/MadBomber","followers_url":"https://api.github.com/users/MadBomber/followers","following_url":"https://api.github.com/users/MadBomber/following{/other_user}","gists_url":"https://api.github.com/users/MadBomber/gists{/gist_id}","starred_url":"https://api.github.com/users/MadBomber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MadBomber/subscriptions","organizations_url":"https://api.github.com/users/MadBomber/orgs","repos_url":"https://api.github.com/users/MadBomber/repos","events_url":"https://api.github.com/users/MadBomber/events{/privacy}","received_events_url":"https://api.github.com/users/MadBomber/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-05-01T18:22:15Z","updated_at":"2015-05-06T16:44:51Z","closed_at":"2015-05-06T16:44:51Z","body":"NoBrainer::Error::DocumentNotPersisted - Duplicate primary key\r\n\r\nMaybe I'm using the wrong pattern.  Within a Sinatra app I call my method get_account(params) which returns an Account record from the RethinkDB database.  If there was no record matching the what I wanted a new is created which means that that get_account(params) always returns an Account model.\r\n\r\nI change a few fields and do account.save expecting the record to be updated.  Instead I get the error about duplicate primary key.  If I do account.update instead I get an error saying that I did not have the proper number of arguments to the update method.\r\n\r\nSo it looks like I have to provide a Hash to the update method for thise fields I want changed.  This feels odd.  I hope I am wrong.\r\n\r\nDewayne\r\n  o-*"}}