andreasronge/neo4j — pull request #352 by cheerfulstoic (2014-05-23 05:46:01+00:00)
Title: orm_adapter

The first big step toward the devise-neo4j gem!

This pull request implements the OrmAdapter (thanks again to @ni-ka for the start) in neo4j.rb 3.x. The shared orm_adapter specs are loaded in from the gem and run as part of the neo4j test suite.

Changes to the neo4j API include;

- find/all no longer take just a set of conditions, but :conditions, :matches, :order, etc... keys
- When creating node objects or querying, the attributes are tested against existing properties / associations and an error is raised when there isn't a match
- When creating node objects, if an association is specified it is currently just stripped out (this might in the future preserve the objects for creating relationships when the object is saved)
- When querying, if an association is specified corresponding WHERE and MATCH clauses are built to match on the relationship

I also built some specs around the new neo4j API changes so that the orm_adapter specs weren't the only thing covering them.

I'll be making another pull request from cheerfulstoic/neo4j-core which this depends on. Happy to discuss any questions / issues