{"action":"created","issue":{"url":"https://api.github.com/repos/balderdashy/waterline/issues/1004","labels_url":"https://api.github.com/repos/balderdashy/waterline/issues/1004/labels{/name}","comments_url":"https://api.github.com/repos/balderdashy/waterline/issues/1004/comments","events_url":"https://api.github.com/repos/balderdashy/waterline/issues/1004/events","html_url":"https://github.com/balderdashy/waterline/issues/1004","id":75928386,"number":1004,"title":"Provide original object, or PK, in beforeUpdate callback","user":{"login":"cyrilchapon","id":10728426,"avatar_url":"https://avatars.githubusercontent.com/u/10728426?v=3","gravatar_id":"","url":"https://api.github.com/users/cyrilchapon","html_url":"https://github.com/cyrilchapon","followers_url":"https://api.github.com/users/cyrilchapon/followers","following_url":"https://api.github.com/users/cyrilchapon/following{/other_user}","gists_url":"https://api.github.com/users/cyrilchapon/gists{/gist_id}","starred_url":"https://api.github.com/users/cyrilchapon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyrilchapon/subscriptions","organizations_url":"https://api.github.com/users/cyrilchapon/orgs","repos_url":"https://api.github.com/users/cyrilchapon/repos","events_url":"https://api.github.com/users/cyrilchapon/events{/privacy}","received_events_url":"https://api.github.com/users/cyrilchapon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/balderdashy/waterline/labels/needs%20community%20feedback","name":"needs community feedback","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2015-05-13T10:05:12Z","updated_at":"2015-05-13T16:03:56Z","closed_at":null,"body":"`beforeUpdate` callback would be much more useful if it carried an `originalObject`, as third argument for example.\r\n\r\nRetrieving original object is only achievable by either :\r\n\r\n- Providing manually, via [policy](http://stackoverflow.com/a/28747257/4578952) or controller, the id in the request body, which is not acceptable\r\n- [Tweaking](http://stackoverflow.com/a/29644240/4578952) and getting raw JS information on the method `this.update.arguments[0]` to get the PK, then `findOne` manually"},"comment":{"url":"https://api.github.com/repos/balderdashy/waterline/issues/comments/101725442","html_url":"https://github.com/balderdashy/waterline/issues/1004#issuecomment-101725442","issue_url":"https://api.github.com/repos/balderdashy/waterline/issues/1004","id":101725442,"user":{"login":"dmarcelino","id":1280446,"avatar_url":"https://avatars.githubusercontent.com/u/1280446?v=3","gravatar_id":"","url":"https://api.github.com/users/dmarcelino","html_url":"https://github.com/dmarcelino","followers_url":"https://api.github.com/users/dmarcelino/followers","following_url":"https://api.github.com/users/dmarcelino/following{/other_user}","gists_url":"https://api.github.com/users/dmarcelino/gists{/gist_id}","starred_url":"https://api.github.com/users/dmarcelino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmarcelino/subscriptions","organizations_url":"https://api.github.com/users/dmarcelino/orgs","repos_url":"https://api.github.com/users/dmarcelino/repos","events_url":"https://api.github.com/users/dmarcelino/events{/privacy}","received_events_url":"https://api.github.com/users/dmarcelino/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T16:03:56Z","updated_at":"2015-05-13T16:03:56Z","body":"> I was talking to @particlebanana about this recently. I think a future version of waterline should pass the criteria as well as the values into beforeUpdate for these sorts of actions. It would have to be a breaking change, of course!\r\n\r\n@devinivy, is there any issue opened for that? If not I think we can re-use this one with a title change."}}