<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/models/indestructible_user.rb</filename>
    </added>
    <added>
      <filename>db/migrate/003_create_indestructible_users.rb</filename>
    </added>
    <added>
      <filename>test/fixtures/indestructible_users.yml</filename>
    </added>
    <added>
      <filename>test/unit/indestructible_user_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,8 @@
 
+May 15
+= require user parameter for destroy and destroy_all methods
+= prefix test models with Indestructible to avoid name collisions with popular model names
+
 May 14
 = add options_excluding_deleted protected method
 </diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,8 @@
 
-= move \app directory to \test to avoid adding models to projects that include this plugin
+= test delete_all with conditions
 
+= move \app directory to \test to avoid adding models to projects that include this plugin
+= test models: need a namespace to avoid name collisions?
 
 === METHODS TO OVERRIDE
 </diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -2,14 +2,17 @@ class CreateIndestructiblePosts &lt; ActiveRecord::Migration
   def self.up
     create_table :indestructible_posts do |t|
       t.datetime :created_at
+      t.datetime :created_by
       t.datetime :updated_at
+      t.datetime :updated_by
       t.datetime :deleted_at
+      t.datetime :deleted_by
       t.string   :title
       t.text     :body
     end
   end
 
   def self.down
-    drop_table :posts
+    drop_table :indestructible_posts
   end
 end</diff>
      <filename>db/migrate/001_create_indestructible_posts.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,14 +2,17 @@ class CreateIndestructibleComments &lt; ActiveRecord::Migration
   def self.up
     create_table :indestructible_comments do |t|
       t.datetime :created_at
+      t.datetime :created_by
       t.datetime :updated_at
+      t.datetime :updated_by
       t.datetime :deleted_at
+      t.datetime :deleted_by
       t.integer  :post_id
       t.text     :body
     end
   end
 
   def self.down
-    drop_table :comments
+    drop_table :indestructible_comments
   end
 end</diff>
      <filename>db/migrate/002_create_indestructible_comments.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,9 @@ module ActiveRecord #:nodoc:
       end
       
       module SingletonMethods
+        def destroy_all(user, conditions = nil)
+          find(:all, :conditions =&gt; conditions).each { |object| object.destroy(user) }
+        end
         def delete(id)
           raise &quot;Is not allowed&quot;
         end
@@ -48,10 +51,11 @@ module ActiveRecord #:nodoc:
         def destroyed?
           !self[:deleted_at].nil?
         end
-        def destroy
+        def destroy(user)
           return if destroyed?
           # a naive implementation for initial testing
           self[:deleted_at] = Time.now
+          self[:deleted_by] = user.id
           save
         end
       end</diff>
      <filename>lib/acts_as_indestructible.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,7 @@ goodbye:
   body: Bye.
 deleted:
   deleted_at: &lt;%= 3.days.ago.to_s :db %&gt;
+  deleted_by: 1
   post: hello
   body: I regretted making this comment.
 deleted_post:</diff>
      <filename>test/fixtures/indestructible_comments.yml</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
 class ActsAsIndestructibleTest &lt; Test::Unit::TestCase
-  fixtures :indestructible_posts, :indestructible_comments
+  fixtures :indestructible_users, :indestructible_posts, :indestructible_comments
   
   def test_fixtures_destroyed?
     assert  indestructible_posts(:deleted).destroyed?
@@ -19,7 +19,7 @@ class ActsAsIndestructibleTest &lt; Test::Unit::TestCase
   def test_destroy
     assert !indestructible_posts(:hello).destroyed?
     
-    indestructible_posts(:hello).destroy
+    indestructible_posts(:hello).destroy(indestructible_users(:ryanlowe))
     
     assert  indestructible_posts(:hello).destroyed?
   end
@@ -29,22 +29,30 @@ class ActsAsIndestructibleTest &lt; Test::Unit::TestCase
     time = indestructible_posts(:deleted)[:deleted_at]
     assert_not_nil time
     
-    indestructible_posts(:deleted).destroy
+    indestructible_posts(:deleted).destroy(indestructible_users(:ryanlowe))
     
     assert indestructible_posts(:deleted).destroyed?
     assert_equal time, indestructible_posts(:deleted)[:deleted_at]
   end
   
+  #
+  # destroy_all(user, conditions = nil)
+  #
+  
   def test_destroy_all
     assert  indestructible_posts(:deleted).destroyed?
     assert !indestructible_posts(:hello).destroyed?
     
-    IndestructiblePost.destroy_all
+    IndestructiblePost.destroy_all(indestructible_users(:ryanlowe))
     
     assert  indestructible_posts(:deleted).reload.destroyed?
     assert  indestructible_posts(:hello).reload.destroyed?
   end
   
+  def test_destroy_all_with_conditions
+    #TODO:
+  end
+  
   #
   # delete
   #</diff>
      <filename>test/unit/acts_as_indestructible_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2e3a9897694eef4a96a03198b2d4a14b7fa0018d</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Lowe</name>
    <email>ryanlowe@gmail.com</email>
  </author>
  <url>http://github.com/ryanlowe/acts_as_indestructible/commit/16c7ed9e5d9dc5b3dbbf3d5961ca4b6efd6077f2</url>
  <id>16c7ed9e5d9dc5b3dbbf3d5961ca4b6efd6077f2</id>
  <committed-date>2008-05-15T17:54:19-07:00</committed-date>
  <authored-date>2008-05-15T17:54:19-07:00</authored-date>
  <message>require user parameter for destroy and destroy_all methods</message>
  <tree>e817faa70ea45145ad78c1a401f3789bb37aed8d</tree>
  <committer>
    <name>Ryan Lowe</name>
    <email>ryanlowe@gmail.com</email>
  </committer>
</commit>
