Reputation: 1712
Is there an alternative in the neo4j ruby wrapper to do a find
and then a create
if the node doesn't exist, in the same way you can do a create_or_update
in ActiveRecord
?
Upvotes: 1
Views: 112
Reputation: 5482
You can use Model.find_or_create_by(property: value)
. http://www.rubydoc.info/github/neo4jrb/neo4j/master/Neo4j/ActiveNode/Persistence/ClassMethods:find_or_create_by
Upvotes: 2