{"action":"created","issue":{"url":"https://api.github.com/repos/neo4jrb/neo4j/issues/997","labels_url":"https://api.github.com/repos/neo4jrb/neo4j/issues/997/labels{/name}","comments_url":"https://api.github.com/repos/neo4jrb/neo4j/issues/997/comments","events_url":"https://api.github.com/repos/neo4jrb/neo4j/issues/997/events","html_url":"https://github.com/neo4jrb/neo4j/issues/997","id":112646853,"number":997,"title":"`after_initialize` callback not working","user":{"login":"pdipietro","id":3890316,"avatar_url":"https://avatars.githubusercontent.com/u/3890316?v=3","gravatar_id":"","url":"https://api.github.com/users/pdipietro","html_url":"https://github.com/pdipietro","followers_url":"https://api.github.com/users/pdipietro/followers","following_url":"https://api.github.com/users/pdipietro/following{/other_user}","gists_url":"https://api.github.com/users/pdipietro/gists{/gist_id}","starred_url":"https://api.github.com/users/pdipietro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdipietro/subscriptions","organizations_url":"https://api.github.com/users/pdipietro/orgs","repos_url":"https://api.github.com/users/pdipietro/repos","events_url":"https://api.github.com/users/pdipietro/events{/privacy}","received_events_url":"https://api.github.com/users/pdipietro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"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},"milestone":null,"comments":17,"created_at":"2015-10-21T18:06:55Z","updated_at":"2015-10-26T14:37:38Z","closed_at":null,"body":"Hi all,\r\n\r\nI'm usually using uuid's for a year without troubles, but now I discover a strange behavior.\r\nI'm running \r\nneo4j (6.0.0.alpha.4, 5.0.15)\r\nneo4j-core (6.0.0.alpha.2, 5.0.10)\r\n\r\nNow I need to assign a value to uuid property just after a Group.new call. But nothing happens. It is returned empty.\r\n\r\nMy controller code is:\r\n```\r\n  # GET /groups/new\r\n  def new\r\n     @group = Group.new\r\n    puts (\"uuid after Group.new: #{@group.uuid}\")\r\n  end\r\n```\r\nThe group.rb code fragment  is\r\n```\r\nclass Group \r\n  include Neo4j::ActiveNode\r\n  include Uuid\r\n\r\n  after_initialize :init_uuid\r\n\r\n  def init_uuid \r\n    puts \"init_uuid called!\"\r\n    @uuid = create_uuid if @uuid.nil?\r\n    puts \"init_uuid is #{@uuid}\"\r\n  end\r\nend\r\n```\r\nAnd finally the module uuid code is\r\n```\r\nmodule Uuid\r\n  extend ActiveSupport::Concern\r\n\r\n  included do \r\n\t\tid_property :uuid, on: :create_uuid\r\n\tend\r\n\r\n\tdef create_uuid\r\n\t\tSecureRandom::uuid\r\n\tend\r\n\r\nend \r\n```\r\n\r\nThe result is \r\n\r\n```\r\nuuid after Group.new: \r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/neo4jrb/neo4j/issues/comments/151158743","html_url":"https://github.com/neo4jrb/neo4j/issues/997#issuecomment-151158743","issue_url":"https://api.github.com/repos/neo4jrb/neo4j/issues/997","id":151158743,"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-10-26T14:37:37Z","updated_at":"2015-10-26T14:37:37Z","body":"Oh, and as for `uuid` specifically, it's set in `inject_defaults!`, https://github.com/neo4jrb/neo4j/blob/c678e7a9c6d7039386bff6f8b6963695b3db137a/lib/neo4j/shared/persistence.rb#L207. The name is a throwback to the earliest version of the id property. The proc that sets the auto uuid is still held in a `default_properties` hash and this method is named like this to keep it consistent. I was going to refactor that out completely but ended up finding a kind of cool use for it, so I left it alone for the time being."}}