{"action":"created","issue":{"url":"https://api.github.com/repos/neo4jrb/neo4j/issues/857","labels_url":"https://api.github.com/repos/neo4jrb/neo4j/issues/857/labels{/name}","comments_url":"https://api.github.com/repos/neo4jrb/neo4j/issues/857/comments","events_url":"https://api.github.com/repos/neo4jrb/neo4j/issues/857/events","html_url":"https://github.com/neo4jrb/neo4j/issues/857","id":93153140,"number":857,"title":"`#persisted?` should not call the database","user":{"login":"cheerfulstoic","id":301415,"avatar_url":"https://avatars.githubusercontent.com/u/301415?v=3","gravatar_id":"","url":"https://api.github.com/users/cheerfulstoic","html_url":"https://github.com/cheerfulstoic","followers_url":"https://api.github.com/users/cheerfulstoic/followers","following_url":"https://api.github.com/users/cheerfulstoic/following{/other_user}","gists_url":"https://api.github.com/users/cheerfulstoic/gists{/gist_id}","starred_url":"https://api.github.com/users/cheerfulstoic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cheerfulstoic/subscriptions","organizations_url":"https://api.github.com/users/cheerfulstoic/orgs","repos_url":"https://api.github.com/users/cheerfulstoic/repos","events_url":"https://api.github.com/users/cheerfulstoic/events{/privacy}","received_events_url":"https://api.github.com/users/cheerfulstoic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-05T22:39:50Z","updated_at":"2015-07-06T15:11:05Z","closed_at":null,"body":"I'm working on a Neo4j adapter for `rails_admin` and one thing that I just ran across is that it does a lot of calls to `#persisted?`.  In neo4j this causes a lot of calls to the database.  I think that the difference comes down to the `#destroyed?` method.  In ActiveRecord this is just a check on the instance variable to see if it's been set as destroyed.  In `neo4j` it also checks `(!new_record? && !exist?)` and it's the `#exist?` that makes the call to the DB.  I'm find with two methods, but we should sort this out.  Curious for all opinions, but particularly @subvertallchris "},"comment":{"url":"https://api.github.com/repos/neo4jrb/neo4j/issues/comments/118885777","html_url":"https://github.com/neo4jrb/neo4j/issues/857#issuecomment-118885777","issue_url":"https://api.github.com/repos/neo4jrb/neo4j/issues/857","id":118885777,"user":{"login":"subvertallchris","id":4097271,"avatar_url":"https://avatars.githubusercontent.com/u/4097271?v=3","gravatar_id":"","url":"https://api.github.com/users/subvertallchris","html_url":"https://github.com/subvertallchris","followers_url":"https://api.github.com/users/subvertallchris/followers","following_url":"https://api.github.com/users/subvertallchris/following{/other_user}","gists_url":"https://api.github.com/users/subvertallchris/gists{/gist_id}","starred_url":"https://api.github.com/users/subvertallchris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/subvertallchris/subscriptions","organizations_url":"https://api.github.com/users/subvertallchris/orgs","repos_url":"https://api.github.com/users/subvertallchris/repos","events_url":"https://api.github.com/users/subvertallchris/events{/privacy}","received_events_url":"https://api.github.com/users/subvertallchris/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T15:11:05Z","updated_at":"2015-07-06T15:11:05Z","body":"Let's just put it in 5.1. It's not a breaking change and I can't see anyone\ncomplaining about it.\n\nOn Monday, July 6, 2015, Brian Underwood <notifications@github.com> wrote:\n\n> Good to know, thanks ;) Since it's an API change I would think it would\n> need to at least be version 5.1, but maybe it should have to wait until 6.0\n> technically?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/neo4jrb/neo4j/issues/857#issuecomment-118884803>.\n>\n"}}