]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/changeset.rb
Fixed bug in changeset idle timeout. Fixed another with a spurious require.
[rails.git] / app / models / changeset.rb
index f67d2118d4382215c7b28460a993a6153f7de98e..38cd8014f734efe2d27629127609cd7813532288 100644 (file)
@@ -25,6 +25,9 @@ class Changeset < ActiveRecord::Base
   MAX_TIME_OPEN = 1
 
   # idle timeout increment, one hour as a rational number of days.
+  # NOTE: DO NOT CHANGE THIS TO 1.hour! when this was done the idle
+  # timeout changed to 1 second, which meant all changesets closed 
+  # almost immediately.
   IDLE_TIMEOUT = Rational(1,24)
 
   # Use a method like this, so that we can easily change how we
@@ -39,6 +42,10 @@ class Changeset < ActiveRecord::Base
     return ((closed_at > DateTime.now) and (num_changes <= MAX_ELEMENTS))
   end
 
+  def set_closed_time_now
+    closed_at = DateTime.now
+  end
+  
   def self.from_xml(xml, create=false)
     begin
       p = XML::Parser.new
@@ -215,7 +222,7 @@ class Changeset < ActiveRecord::Base
     
     # can't change a closed changeset
     unless is_open?
-      raise OSM::APIChangesetAlreadyClosedError
+      raise OSM::APIChangesetAlreadyClosedError.new(self)
     end
 
     # copy the other's tags