neo4jrb / activegraph

An active model wrapper for the Neo4j Graph Database for Ruby.
http://neo4jrb.io
MIT License
1.4k stars 276 forks source link

Enforcing has_one reverse rel with a flag #1566

Closed amitsuryavanshi closed 5 years ago

amitsuryavanshi commented 5 years ago

With the changes in #1548 and #1560 , we deleted the reverse has_one rel if we found there already exists one before creating a new one. We are correcting this with adding a config flag enforce_has_one, which when set will raise a error rather than deleting relations silently. Flag is by default not set and the has_one rel restriction is not enforced.

Additional information which could be helpful if relevant to your issue:

Code example (inline, gist, or repo)

Runtime information:

Neo4j database version: neo4j gem version: 9.5.2 neo4j-core gem version: NA