{"action":"created","issue":{"url":"https://api.github.com/repos/geddy/model/issues/264","labels_url":"https://api.github.com/repos/geddy/model/issues/264/labels{/name}","comments_url":"https://api.github.com/repos/geddy/model/issues/264/comments","events_url":"https://api.github.com/repos/geddy/model/issues/264/events","html_url":"https://github.com/geddy/model/issues/264","id":121742770,"number":264,"title":"about `save` method and model's id","user":{"login":"class4cxy","id":3863170,"avatar_url":"https://avatars.githubusercontent.com/u/3863170?v=3","gravatar_id":"","url":"https://api.github.com/users/class4cxy","html_url":"https://github.com/class4cxy","followers_url":"https://api.github.com/users/class4cxy/followers","following_url":"https://api.github.com/users/class4cxy/following{/other_user}","gists_url":"https://api.github.com/users/class4cxy/gists{/gist_id}","starred_url":"https://api.github.com/users/class4cxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/class4cxy/subscriptions","organizations_url":"https://api.github.com/users/class4cxy/orgs","repos_url":"https://api.github.com/users/class4cxy/repos","events_url":"https://api.github.com/users/class4cxy/events{/privacy}","received_events_url":"https://api.github.com/users/class4cxy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-11T16:28:04Z","updated_at":"2015-12-11T19:05:19Z","closed_at":null,"body":"hi :\r\n\r\nmy question is after i call the model.save() method, how can i get the current model's id ? and mysql db is design to `auto_increment`.\r\ni was try to use `\"SELECT LAST_INSERT_ID() as id FROM \"` after save's callback, but it dosen't suit when concurrent request"},"comment":{"url":"https://api.github.com/repos/geddy/model/issues/comments/164020289","html_url":"https://github.com/geddy/model/issues/264#issuecomment-164020289","issue_url":"https://api.github.com/repos/geddy/model/issues/264","id":164020289,"user":{"login":"class4cxy","id":3863170,"avatar_url":"https://avatars.githubusercontent.com/u/3863170?v=3","gravatar_id":"","url":"https://api.github.com/users/class4cxy","html_url":"https://github.com/class4cxy","followers_url":"https://api.github.com/users/class4cxy/followers","following_url":"https://api.github.com/users/class4cxy/following{/other_user}","gists_url":"https://api.github.com/users/class4cxy/gists{/gist_id}","starred_url":"https://api.github.com/users/class4cxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/class4cxy/subscriptions","organizations_url":"https://api.github.com/users/class4cxy/orgs","repos_url":"https://api.github.com/users/class4cxy/repos","events_url":"https://api.github.com/users/class4cxy/events{/privacy}","received_events_url":"https://api.github.com/users/class4cxy/received_events","type":"User","site_admin":false},"created_at":"2015-12-11T19:05:19Z","updated_at":"2015-12-11T19:05:19Z","body":"thanks for reply.\r\nyou means i can get the id from model instance ?\r\nlike this ?\r\n`var user = User.create(params);`\r\n`user.save(function () { alert(user.id) })`"}}