<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -40,4 +40,7 @@ If you have provided a &lt;tt&gt;ham_comments_count&lt;/tt&gt; attribute on your comment's p
 
 Much love to Jonathan Snook, web developer extraordinaire. Most of the ideas/algorithms of ActsAsSnook [as well as the name, obviously] come from his blog post which you can find here[http://snook.ca/archives/other/effective_blog_comment_spam_blocker] The actual Ruby implementation I myself wrote.
 
+Thanks also to the following for their help and suggestions:
+Dana Jones
+
 Copyright (c) 2008 Lucky Sneaks, released under the MIT license</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -267,6 +267,10 @@ module LuckySneaks
       changes.has_key? self.class.fields_for_snooking[:spam_status_field].to_s
     end
     
+    def snook_spam_status_changes
+      changes[self.class.fields_for_snooking[:spam_status_field].to_s]
+    end
+    
     def increment_ham_comments_count
       if ham? &amp;&amp; snook_entry
         snook_entry.increment!(self.class.fields_for_snooking[:ham_comments_count_field])
@@ -275,7 +279,11 @@ module LuckySneaks
     
     def adjust_ham_comments_count
       if snook_spam_status_changed?
-        ham? ? increment_ham_comments_count : decrement_ham_comments_count
+        if ham?
+          increment_ham_comments_count
+        elsif snook_spam_status_changes == [&quot;ham&quot;, &quot;spam&quot;]
+          decrement_ham_comments_count
+        end
       end
     end
     </diff>
      <filename>lib/lucky_sneaks/acts_as_snook.rb</filename>
    </modified>
    <modified>
      <diff>@@ -29,11 +29,7 @@ class ActsAsSnookInterfaceTest &lt; Test::Unit::TestCase
   
   def test_indicates_spam_status_of_comments_needing_moderation
     # This is a hard spot to hit!
-    @comment = Comment.new(
-      :author =&gt; &quot;Mister Mxyzptlk&quot;,
-      :url =&gt; &quot;http://superman.de&quot;,
-      :body =&gt; &quot;I take viagra and cialis but I'm not selling it.&quot;
-    )
+    @comment = Comment.new(MODERATE_COMMENT)
     assert @comment.moderate?
   end
   
@@ -141,6 +137,16 @@ class ActsAsSnookInterfaceTest &lt; Test::Unit::TestCase
     @comment.destroy
   end
   
+  def test_updating_moderate_spam_status_to_spam_does_not_decrement_ham_comments_count
+    @comment = Entry.find(:first).comments.create!(MODERATE_COMMENT)
+    @comment.save!
+    assert_no_difference(&quot;Entry.find(:first).ham_comments_count&quot;) do
+      @comment.spam_status = &quot;spam&quot;
+      @comment.save!
+    end
+    @comment.destroy
+  end
+  
   def test_destroying_ham_comment_decrements_ham_comment_count
     @comment = Entry.find(:first).comments.create!(HAM_COMMENTS[0])
     assert_difference &quot;Entry.find(:first).ham_comments_count&quot;, -1 do
@@ -154,4 +160,11 @@ class ActsAsSnookInterfaceTest &lt; Test::Unit::TestCase
       @comment.destroy
     end
   end
+  
+  def test_destroying_moderate_comment_does_not_decrement_ham_comment_count
+    @comment = Entry.find(:first).comments.create!(MODERATE_COMMENT)
+    assert_no_difference &quot;Entry.find(:first).ham_comments_count&quot; do
+      @comment.destroy
+    end
+  end
 end
\ No newline at end of file</diff>
      <filename>test/acts_as_snook_interface_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -50,6 +50,10 @@ class Test::Unit::TestCase # :nodoc:
     }.merge(options))
   end
   
+  def moderate_comment(options = {})
+    Comment.new(MODERATE_COMMENT.merge(options))
+  end
+  
   def setup_prior_comments
     good_comment.save
     good_comment(:body =&gt; &quot;Something different.&quot;).save
@@ -130,6 +134,12 @@ class Test::Unit::TestCase # :nodoc:
     }
   ]
   
+  MODERATE_COMMENT = {
+    :author =&gt; &quot;Mister Mxyzptlk&quot;,
+    :url =&gt; &quot;http://superman.de&quot;,
+    :body =&gt; &quot;I take viagra and cialis but I'm not selling it.&quot;
+  }
+  
   # From Active Support
   def assert_difference(expressions, difference = 1, message = nil, &amp;block)
     expression_evaluations = Array(expressions).collect{ |expression| lambda { eval(expression, block.send(:binding)) } }</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ef33b7616698aaa2bbf54a569894ae19accff756</id>
    </parent>
  </parents>
  <author>
    <name>RSL</name>
    <email>rsl@luckysneaks.com</email>
  </author>
  <url>http://github.com/rsl/acts_as_snook/commit/52b9e8b98dfb1cd51dd5213fd20016027d90a0ed</url>
  <id>52b9e8b98dfb1cd51dd5213fd20016027d90a0ed</id>
  <committed-date>2009-05-17T06:45:52-07:00</committed-date>
  <authored-date>2009-05-17T06:45:52-07:00</authored-date>
  <message>updated to not decrement ham count when moving from moderate to spam</message>
  <tree>eebf5a1486b58d944dc8f123b554a8220b44ef93</tree>
  <committer>
    <name>RSL</name>
    <email>rsl@luckysneaks.com</email>
  </committer>
</commit>
