{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/586","labels_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/586/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/586/comments","events_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/586/events","html_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/586","id":75557785,"number":586,"title":"Add new hook `persist`","user":{"login":"PradnyaBaviskar","id":10217160,"avatar_url":"https://avatars.githubusercontent.com/u/10217160?v=3","gravatar_id":"","url":"https://api.github.com/users/PradnyaBaviskar","html_url":"https://github.com/PradnyaBaviskar","followers_url":"https://api.github.com/users/PradnyaBaviskar/followers","following_url":"https://api.github.com/users/PradnyaBaviskar/following{/other_user}","gists_url":"https://api.github.com/users/PradnyaBaviskar/gists{/gist_id}","starred_url":"https://api.github.com/users/PradnyaBaviskar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PradnyaBaviskar/subscriptions","organizations_url":"https://api.github.com/users/PradnyaBaviskar/orgs","repos_url":"https://api.github.com/users/PradnyaBaviskar/repos","events_url":"https://api.github.com/users/PradnyaBaviskar/events{/privacy}","received_events_url":"https://api.github.com/users/PradnyaBaviskar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/labels/%23community%20contribution","name":"#community contribution","color":"D4AF37"}],"state":"open","locked":false,"assignee":{"login":"bajtos","id":1140553,"avatar_url":"https://avatars.githubusercontent.com/u/1140553?v=3","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},"milestone":null,"comments":14,"created_at":"2015-05-12T10:40:16Z","updated_at":"2015-06-10T04:53:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/pulls/586","html_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/586","diff_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/586.diff","patch_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/586.patch"},"body":"Connect to #559\r\n\r\nPoints to note -\r\n - During `create` the updates applied through `persist` hook are reflected into the database, but the same updates are NOT reflected in the `instance` object obtained in callback of `create`.\r\n - Secondly, `findOrCreate`, creates a new instance of the object every time. So, \r\n  - Both `ctx.data.id` and `ctx.currentInstance.id` are set to new id. \r\n  - And, `ctx.isNewInstance` is `true`\r\n  \r\n \r\n@bajtos, can you please review?"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/comments/110588193","html_url":"https://github.com/strongloop/loopback-datasource-juggler/pull/586#issuecomment-110588193","issue_url":"https://api.github.com/repos/strongloop/loopback-datasource-juggler/issues/586","id":110588193,"user":{"login":"PradnyaBaviskar","id":10217160,"avatar_url":"https://avatars.githubusercontent.com/u/10217160?v=3","gravatar_id":"","url":"https://api.github.com/users/PradnyaBaviskar","html_url":"https://github.com/PradnyaBaviskar","followers_url":"https://api.github.com/users/PradnyaBaviskar/followers","following_url":"https://api.github.com/users/PradnyaBaviskar/following{/other_user}","gists_url":"https://api.github.com/users/PradnyaBaviskar/gists{/gist_id}","starred_url":"https://api.github.com/users/PradnyaBaviskar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PradnyaBaviskar/subscriptions","organizations_url":"https://api.github.com/users/PradnyaBaviskar/orgs","repos_url":"https://api.github.com/users/PradnyaBaviskar/repos","events_url":"https://api.github.com/users/PradnyaBaviskar/events{/privacy}","received_events_url":"https://api.github.com/users/PradnyaBaviskar/received_events","type":"User","site_admin":false},"created_at":"2015-06-10T04:53:00Z","updated_at":"2015-06-10T04:53:00Z","body":"Pushed the changes per the recent comments - please review."}}