I have the following model:
class User
include Neo4j::ActiveNode
end
and I simply want to specify the primary key at creation time:
user = User.create(id: SecureRandom.uuid)
However, this does not work and return Undefined properties: id
.
I have tried with a custom id_property
definition:
class User
include Neo4j::ActiveNode
id_property :user_id
end
While this works, it won't provide a default id when doing User.create
. So I tried:
class User
include Neo4j::ActiveNode
id_property :user_id, auto: :uuid
end
which will assign a default uuid but does not allow User.create(user_id: xxx)
anymore!
This is driving me crazy! Am I missing something here?