{"action":"created","issue":{"url":"https://api.github.com/repos/tgriesser/bookshelf/issues/862","labels_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/862/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/862/comments","events_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/862/events","html_url":"https://github.com/tgriesser/bookshelf/issues/862","id":99021826,"number":862,"title":"How to prevent to throw \"No rows were affected in the update\"?","user":{"login":"sandro-csimas","id":1282074,"avatar_url":"https://avatars.githubusercontent.com/u/1282074?v=3","gravatar_id":"","url":"https://api.github.com/users/sandro-csimas","html_url":"https://github.com/sandro-csimas","followers_url":"https://api.github.com/users/sandro-csimas/followers","following_url":"https://api.github.com/users/sandro-csimas/following{/other_user}","gists_url":"https://api.github.com/users/sandro-csimas/gists{/gist_id}","starred_url":"https://api.github.com/users/sandro-csimas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandro-csimas/subscriptions","organizations_url":"https://api.github.com/users/sandro-csimas/orgs","repos_url":"https://api.github.com/users/sandro-csimas/repos","events_url":"https://api.github.com/users/sandro-csimas/events{/privacy}","received_events_url":"https://api.github.com/users/sandro-csimas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tgriesser/bookshelf/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-08-04T17:45:52Z","updated_at":"2015-08-05T22:05:09Z","closed_at":null,"body":"Hi, i'm trying to execute the follow update:\r\n````\r\nupdate `user_activity` set `parameters` = ?, `place_id` = ? where `place_id` = ?\r\n````\r\nSo i write:\r\n````\r\nreturn UserActivity.where({place_id: place.id}).save({place_id: null, parameters: JSON.stringify({place_name: this.place.get('name')})}, {method: 'update', patch: true, transacting: transaction});\r\n````\r\nThe update is correct but i'm getting the follow error:\r\n````\r\nError: No rows were affected in the update, did you mean to pass the {method: \"insert\"} option?\r\n````\r\nHow to prevent this behavior? I try \"require\": false but is not working.\r\n"},"comment":{"url":"https://api.github.com/repos/tgriesser/bookshelf/issues/comments/128163494","html_url":"https://github.com/tgriesser/bookshelf/issues/862#issuecomment-128163494","issue_url":"https://api.github.com/repos/tgriesser/bookshelf/issues/862","id":128163494,"user":{"login":"sandro-csimas","id":1282074,"avatar_url":"https://avatars.githubusercontent.com/u/1282074?v=3","gravatar_id":"","url":"https://api.github.com/users/sandro-csimas","html_url":"https://github.com/sandro-csimas","followers_url":"https://api.github.com/users/sandro-csimas/followers","following_url":"https://api.github.com/users/sandro-csimas/following{/other_user}","gists_url":"https://api.github.com/users/sandro-csimas/gists{/gist_id}","starred_url":"https://api.github.com/users/sandro-csimas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandro-csimas/subscriptions","organizations_url":"https://api.github.com/users/sandro-csimas/orgs","repos_url":"https://api.github.com/users/sandro-csimas/repos","events_url":"https://api.github.com/users/sandro-csimas/events{/privacy}","received_events_url":"https://api.github.com/users/sandro-csimas/received_events","type":"User","site_admin":false},"created_at":"2015-08-05T22:05:09Z","updated_at":"2015-08-05T22:05:09Z","body":"@rhys-vdw, the query is generated correctly, but even with require false, the error is throwed. There is no user_activity with place_id 2, but this is an excpected behavior. I know that save does not save in bulk, but he generated the correct update.\r\nI will try your code. Thanks!"}}