diff --git a/CHANGELOG b/CHANGELOG index 4798b27bb..29c5fd3b0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,11 @@ +== 0.3.1 / 2009-07-25 + * Feature, extension - find path between given pair of nodes (#58) + * Fix a messy exception on GET /nodes/UnknownClassName (#57) + * Bug - exception on GET /nodes/classname/rel if rel is a has_one relationship (#56) + * Bug: GET /nodes/classname missing out nodes with no properties (#55) + * Bug: Lucene sorting caused exception if there were no documents (#54) + * Bug: reindexer fails to connect nodes to the IndexNode (#53) + == 0.3.0 / 2009-06-25 * Neo4j should track node changes * RESTful support for lucene queries, sorting and paging diff --git a/README.rdoc b/README.rdoc index b81f2f117..4e8095b36 100644 --- a/README.rdoc +++ b/README.rdoc @@ -53,7 +53,8 @@ This page contains the following information: * Ten Minute Tutorial * Lucene API Documentation * Neo4j API Documentation -* Extensions: REST (see Neo4j::RestMixin) +* Extension: REST (see Neo4j::RestMixin) +* Extension: find_path * Ruby on Rails with Neo4j.rb There is also some complete examples in the example folder @@ -1426,9 +1427,22 @@ It requires the following gems For RSpec testing it also needs: * rack-test -For more information see the test/rest/example.rb or the examples/admin or Neo4j::RestMixin. +For more information see the examples/rest/example.rb or the examples/admin or Neo4j::RestMixin. +== Extension: find_path + +Extension which finds the shortest path (in terms of number of links) between +two nodes. Use something like this: + + require 'neo4j/extensions/find_path' + node1.traverse.both(:knows).depth(:all).path_to(node2) + # => [node1, node42, node1234, node256, node2] + +This extension is still rather experimental. The algorithm is based on the one +used in the Neo4j Java IMDB example. For more information see Neo4j::Relationships::NodeTraverser#path_to +or the RSpec find_path_spec.rb. + == Ruby on Rails with Neo4j.rb Neo4j.rb does work nicely with R&R. diff --git a/lib/neo4j/extensions/tx_tracker.rb b/lib/neo4j/extensions/tx_tracker.rb index 08570b8f1..07bda2356 100644 --- a/lib/neo4j/extensions/tx_tracker.rb +++ b/lib/neo4j/extensions/tx_tracker.rb @@ -255,9 +255,13 @@ def create_node_with_uuid(uuid) # def self.on_neo_started(neo_instance) - return if neo_instance.ref_node.relationship?(:tx_node_list) - @tx_node_list = TxNodeList.new # cache this so we do not have to look it up always - neo_instance.ref_node.relationships.outgoing(:tx_node_list) << @tx_node_list + # has the tx_node_list already been created ? + unless neo_instance.ref_node.relationship?(:tx_node_list) + # it does not exist - create it + neo_instance.ref_node.relationships.outgoing(:tx_node_list) << TxNodeList.new + end + # cache this so we do not have to look it up always + @tx_node_list = neo_instance.ref_node.relationships.outgoing(:tx_node_list).nodes.first Neo4j.event_handler.add(@tx_node_list) end @@ -269,6 +273,7 @@ def self.on_neo_stopped(neo_instance) def self.instance + Neo4j.start unless @tx_node_list @tx_node_list end end diff --git a/lib/neo4j/version.rb b/lib/neo4j/version.rb index 9546e8caf..bf1d97014 100644 --- a/lib/neo4j/version.rb +++ b/lib/neo4j/version.rb @@ -1,3 +1,3 @@ module Neo4j - VERSION = '0.3.0' unless defined?(Neo4j::VERSION) + VERSION = '0.3.1' unless defined?(Neo4j::VERSION) end