<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -49,6 +49,8 @@ module Burndown
       if !self.active?
         self.update_attributes(:closed_at =&gt; Time.now)
         return true
+      else
+        self.update_attributes(:closed_at =&gt; nil) if !self.closed_at.nil?
       end
       
       results = Lighthouse.get_milestone_tickets(self.name, self.project.remote_id, self.project.token.account, self.project.token.token)</diff>
      <filename>lib/burndown/milestone.rb</filename>
    </modified>
    <modified>
      <diff>@@ -122,7 +122,16 @@ class MiilestoneTest &lt; Test::Unit::TestCase
       @existing.closed_at.should_not be_nil
     end
     
-    it &quot;reopenes the milestone if there are open tickets&quot;
+    it &quot;reopenes the milestone if there are open tickets&quot; do
+      closed = Milestone.generate(:remote_id =&gt; 42, :tickets_count =&gt; 20, :open_tickets_count =&gt; 0, :name =&gt; &quot;ClosedMilestone&quot;, :due_on =&gt; DateTime.new(2006, 06, 06), :project_id =&gt; @activated_project.id, :closed_at =&gt; DateTime.new(2006, 07, 07))
+      closed.should_not be_active
+      closed.closed_at.should_not be_nil
+      
+      closed.sync_with_lighthouse
+      
+      closed.should be_active
+      closed.closed_at.should be_nil
+    end
   end
   
 end
\ No newline at end of file</diff>
      <filename>test/unit/miilestone_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d3ea1230bb9f0cc86b58b0a0f37840a58bb9d744</id>
    </parent>
  </parents>
  <author>
    <name>Kyle Neath</name>
    <email>kneath@gmail.com</email>
  </author>
  <url>http://github.com/kneath/lighthouse_burndown/commit/dacd81975484fc1393cd08e3281c2d650b99bd64</url>
  <id>dacd81975484fc1393cd08e3281c2d650b99bd64</id>
  <committed-date>2009-05-02T16:51:54-07:00</committed-date>
  <authored-date>2009-05-02T16:51:54-07:00</authored-date>
  <message>Close and reopen milestones based on open tickets</message>
  <tree>b2bfba57c3ab2c0b9100a541043f8cb8019b886e</tree>
  <committer>
    <name>Kyle Neath</name>
    <email>kneath@gmail.com</email>
  </committer>
</commit>
