<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -63,7 +63,7 @@ module ActiveRecord
 
             #{scope_condition_method}
 
-            after_destroy  :remove_from_list
+            before_destroy :remove_from_list
             before_create  :add_to_list_bottom
           EOV
         end
@@ -121,7 +121,10 @@ module ActiveRecord
 
         # Removes the item from the list.
         def remove_from_list
-          decrement_positions_on_lower_items if in_list?
+          if in_list?
+            decrement_positions_on_lower_items
+            update_attribute position_column, nil
+          end
         end
 
         # Increase the position of this item without adjusting the rest of the list.</diff>
      <filename>lib/active_record/acts/list.rb</filename>
    </modified>
    <modified>
      <diff>@@ -187,7 +187,40 @@ class ListTest &lt; Test::Unit::TestCase
     new2.move_higher
     assert_equal [new2, new1, new3], ListMixin.find(:all, :conditions =&gt; 'parent_id IS NULL', :order =&gt; 'pos')
   end
-
+  
+  
+  def test_remove_from_list_should_then_fail_in_list? 
+    assert_equal true, ListMixin.find(1).in_list?
+    ListMixin.find(1).remove_from_list
+    assert_equal false, ListMixin.find(1).in_list?
+  end 
+  
+  def test_remove_from_list_should_set_position_to_nil 
+    assert_equal [1, 2, 3, 4], ListMixin.find(:all, :conditions =&gt; 'parent_id = 5', :order =&gt; 'pos').map(&amp;:id)
+  
+    ListMixin.find(2).remove_from_list 
+  
+    assert_equal [2, 1, 3, 4], ListMixin.find(:all, :conditions =&gt; 'parent_id = 5', :order =&gt; 'pos').map(&amp;:id)
+  
+    assert_equal 1,   ListMixin.find(1).pos
+    assert_equal nil, ListMixin.find(2).pos
+    assert_equal 2,   ListMixin.find(3).pos
+    assert_equal 3,   ListMixin.find(4).pos
+  end 
+  
+  def test_remove_before_destroy_does_not_shift_lower_items_twice 
+    assert_equal [1, 2, 3, 4], ListMixin.find(:all, :conditions =&gt; 'parent_id = 5', :order =&gt; 'pos').map(&amp;:id)
+  
+    ListMixin.find(2).remove_from_list 
+    ListMixin.find(2).destroy 
+  
+    assert_equal [1, 3, 4], ListMixin.find(:all, :conditions =&gt; 'parent_id = 5', :order =&gt; 'pos').map(&amp;:id)
+  
+    assert_equal 1, ListMixin.find(1).pos
+    assert_equal 2, ListMixin.find(3).pos
+    assert_equal 3, ListMixin.find(4).pos
+  end 
+  
 end
 
 class ListSubTest &lt; Test::Unit::TestCase</diff>
      <filename>test/list_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>27a941c80ccaa8afeb9bfecb84c0ff098d8ba962</id>
    </parent>
  </parents>
  <author>
    <name>Michael Koziarski</name>
    <email>michael@koziarski.com</email>
  </author>
  <url>http://github.com/rails/acts_as_list/commit/9baff190a52c05cc542bfcaa7f77a91ce669f2f8</url>
  <id>9baff190a52c05cc542bfcaa7f77a91ce669f2f8</id>
  <committed-date>2007-10-08T22:31:19-07:00</committed-date>
  <authored-date>2007-10-08T22:31:19-07:00</authored-date>
  <message>Make sure acts_as_list's remove_from_list and in_list? play nicely with one another. References #8822 [mikel] </message>
  <tree>7b9aac005404180dfc96b2b70b4672ef4b71c9fd</tree>
  <committer>
    <name>Michael Koziarski</name>
    <email>michael@koziarski.com</email>
  </committer>
</commit>
