yournextleap/activerecord-neo4j-adapter — pull request #2 by mavenik (2012-04-05 14:52:45+00:00)
Title: Optimizations and reorganization of model nodes

Optimizations:
* Added __type__ property to instance nodes (inspired by SpringDataGraph)
* Modified load_from_graph to use __type__ property to allocate a new instance. If a __type__ property was not found, it would simply look up for an incoming model node
* Added rake task to migrate older instance nodes with a new __type__ property associated to it. This could be executed using ```bundle exec rake neo4j_rest:add_type_to_instances```

Reorganization:
* Added support for specifying an explicit root node id in database.yml. This helps in taking graphSON backups effectively.
* Model nodes contained column definitions as an Array of Hashes. This made it difficult to de-serialize when restoring the graph from a graphSON file. Column definitions are now stored as a String. (Evil eval being used to de-serialize the String)
* Model nodes are connected to root node now. This makes it possible to regenerate indices from a restored graph.
* Added rake tasks for migrating models, restoring indexes

To migrate models to a new scheme:
```bundle exec rake neo4j_rest:migrate_models```

To restore indices from an imported graphSON
```bundle exec rake neo4j_rest:restore```