<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -11,7 +11,11 @@ class SpamReport &lt; ActiveRecord::Base
     if comment.matching_spam_reports.empty?
       create!(:comment =&gt; comment, :hit_count =&gt; 1)
     else
-      comment.matching_spam_reports.each { |r| r.increment! :hit_count }
+      comment.matching_spam_reports.each do |r|
+        r.increment :hit_count
+        r.confirmed_at = nil
+        r.save!
+      end
     end
   end
   </diff>
      <filename>app/models/spam_report.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,14 +28,16 @@ describe SpamReport do
     report.matching_comments.should_not include(good)
   end
   
-  it &quot;should increment hit count when reporting comment spam that already exists&quot; do
+  it &quot;should increment hit count when reporting comment spam that already exists and reset confirmation&quot; do
     SpamReport.delete_all # delete so comment doesn't match an older report
     bad = Factory(:comment, :name =&gt; 'badbadbad')
     bad_2 = Factory(:comment, :name =&gt; 'badbadbad')
     report = SpamReport.report_comment(bad)
     report.reload.hit_count.should == 1
+    report.update_attribute(:confirmed_at, Time.now)
     SpamReport.report_comment(bad_2)
     report.reload.hit_count.should == 2
+    report.confirmed_at.should be_nil
   end
   
   it &quot;should remove matching comments when confirming&quot; do</diff>
      <filename>spec/models/spam_report_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>23145fc1bd2a3843207fd69b2b56c27cd32ed23e</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Bates</name>
    <email>ryan@railscasts.com</email>
  </author>
  <url>http://github.com/ryanb/railscasts/commit/2ad8da3946ae03634e4816615acb0996ac6f21ce</url>
  <id>2ad8da3946ae03634e4816615acb0996ac6f21ce</id>
  <committed-date>2009-10-28T16:04:18-07:00</committed-date>
  <authored-date>2009-10-28T16:04:18-07:00</authored-date>
  <message>unconfirm spam report if a spam is added after it's confirmed</message>
  <tree>7bdb4b9e6508af0189b53d8b50be2d93e18a068e</tree>
  <committer>
    <name>Ryan Bates</name>
    <email>ryan@railscasts.com</email>
  </committer>
</commit>
