<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -18,8 +18,7 @@ It uses two powerful and mature java libraries:
 
 === Status
 * There are over 400 RSpecs.
-* Has been tested with a simple rails application, used Neo4j.rb instead of ActiveRecord
-* Has been load tested (loaded 18000 nodes and done queries/traversal in several threads.)
+* Has been tested with rails applications, used Neo4j.rb instead of ActiveRecord
 
 === Project information
 * GitHub - http://github.com/andreasronge/neo4j/tree/master
@@ -33,7 +32,6 @@ It uses two powerful and mature java libraries:
 * Ruby Manor 2008 - Jonathan Conway: http://jaikoo.com/assets/presentations/neo4j.pdf
 * Neo4j wiki - http://wiki.neo4j.org/content/Main_Page (check the guidelines and domain modeling gallery pages)
 
-
 === Contributing
 
 Have you found a bug, need help or have a patch ?
@@ -62,7 +60,7 @@ There are also some complete examples in the example folder
 * railway - an example of a railway network application
 * imdb - an example of a neo4j database consisting of movies, role and actors nodes/relationships (over 18000 nodes).
 * rest - an example how to expose neo4j nodes as REST resources
-* Ruby on Rails - see http://github.com/andreasronge/neo4j-rails-example/tree/master
+* Ruby on Rails - see http://github.com/andreasronge/neo4j-rails-example/tree/master or http://github.com/sashaagafonoff/peoplemap
 
 == Installation
 </diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,19 @@
 module Neo4j
 
   module NodeMixin
+    alias :old_ignore_incoming_cascade_delete? :ignore_incoming_cascade_delete?
+
+    def ignore_incoming_cascade_delete? (node, relationship)
+      return true if old_ignore_incoming_cascade_delete?(node,relationship)
+
+      5.times {puts &quot;-------------------------------&quot;}
+      puts &quot;ignore_incoming_cascade_delete&quot;
+      node.print 1,:both
+      5.times {puts &quot;-------------------------------&quot;}
+
+      # if it's an index node relationship then it should be allowed to cascade delete the node
+      return relationship.other_node(node) == IndexNode.instance
+    end
 
     module ClassMethods
 </diff>
      <filename>lib/neo4j/extensions/reindexer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,7 +27,7 @@ module Neo4j
 
     # only for testing purpose, e.g we need to redefine an existing class
     def self.remove_instance(clazz)
-      @instances.delete(clazz.root_class) unless @instances.nil?
+      @instances.delete(clazz.root_class) if !@instances.nil? &amp;&amp; clazz.respond_to?(:root_class)
     end
 
 </diff>
      <filename>lib/neo4j/indexer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -284,7 +284,7 @@ module Neo4j
           # check node has no outgoing relationships
           no_outgoing = node.relationships.outgoing.empty?
           # check node has only incoming relationship with cascade_delete_incoming
-          no_incoming = node.relationships.incoming.find{|r| !r.property?(:_cascade_delete_incoming)}.nil?
+          no_incoming = node.relationships.incoming.find{|r| !ignore_incoming_cascade_delete?(node, r)}.nil?
           # only cascade delete incoming if no outgoing and no incoming (exception cascade_delete_incoming) relationships
           node.delete if no_outgoing and no_incoming
         end
@@ -294,6 +294,14 @@ module Neo4j
     end
 
 
+    # Specifies which relationships should be ignored when trying to cascade delete a node.
+    # If a node does not have any relationships (except those specified here to ignore) it will be cascade deleted
+    #
+    def ignore_incoming_cascade_delete?(node, relationship)
+      # ignore relationship with property _cascade_delete_incoming
+      relationship.property?(:_cascade_delete_incoming)
+    end
+
     # Updates the index for this node.
     # This method will be automatically called when needed
     # (a property changed or a relationship was created/deleted)</diff>
      <filename>lib/neo4j/mixins/node_mixin.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,6 @@ $LOAD_PATH &lt;&lt; File.expand_path(File.dirname(__FILE__) + &quot;/..&quot;)
 require 'neo4j'
 require 'neo4j/spec_helper'
 
-
 describe &quot;Cascade Delete for raw relationships&quot; do
 
   before(:all) do
@@ -363,11 +362,10 @@ describe &quot;Cascade Delete chained&quot; do
 
   after(:all) do
     stop
+    undefine_class :OrderLine, :OrderStatus, :Order
   end
   
   it &quot;should delete a chained relationship of cascaded objects&quot; do
-    pending &quot;Must avoid cascade delete when using the reindexer extension&quot;
-    
     # OrderStatus ---&gt; Order ---*&gt;OrderLine
     class OrderLine
       include Neo4j::NodeMixin</diff>
      <filename>test/neo4j/cascade_delete_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,8 +22,12 @@ describe &quot;CustomerA,Order,Product&quot; do
   #   7. What is the mark-up on a certain P&amp;roduct
 
 
+  after(:all) do
+    undefine_class :Order, :CustomerA, :Product, :OrderLine
+  end
+
   before(:all) do
-    undefine_class :Order, :CustomerA, :Product
+#    undefine_class :Order, :CustomerA, :Product
 
 
     class Order</diff>
      <filename>test/neo4j/order_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3e20bd6063e587ea389de0541d158b288d0c8113</id>
    </parent>
  </parents>
  <author>
    <name>andreas</name>
    <email>andreas@andreas-xps16.(none)</email>
  </author>
  <url>http://github.com/andreasronge/neo4j/commit/4de7d5fc2268320550b1d89499df3241f3753106</url>
  <id>4de7d5fc2268320550b1d89499df3241f3753106</id>
  <committed-date>2009-10-26T13:00:54-07:00</committed-date>
  <authored-date>2009-10-26T13:00:54-07:00</authored-date>
  <message>Fixed cascade delete - now also works on a chain of different Node classes. Also fixed cascade delete so it works together with the ReIndexer extension. [#81]</message>
  <tree>eae29859d34418e829a531a11717c57ea5213ef1</tree>
  <committer>
    <name>andreas</name>
    <email>andreas@andreas-xps16.(none)</email>
  </committer>
</commit>
