]> git.openstreetmap.org Git - rails.git/commitdiff
Potlatch for API 0.6 now saving ways happily with node versioning... I think
authorRichard Fairhurst <richard@systemed.net>
Thu, 18 Dec 2008 00:32:02 +0000 (00:32 +0000)
committerRichard Fairhurst <richard@systemed.net>
Thu, 18 Dec 2008 00:32:02 +0000 (00:32 +0000)
app/controllers/amf_controller.rb
app/models/changeset.rb
public/potlatch/potlatch.swf

index b6e3bf3514ac5b22a2e5083e5998379e35221021..80472fe254c3dbb0f876050d209b6f77b4ed39f9 100644 (file)
@@ -458,12 +458,12 @@ class AmfController < ApplicationController
       return [0, relid, relation.id, relation.version]
     end
   rescue OSM::APIChangesetAlreadyClosedError => ex
       return [0, relid, relation.id, relation.version]
     end
   rescue OSM::APIChangesetAlreadyClosedError => ex
-    return [-1, "The changeset #{ex.changeset.id} was closed at #{ex.changeset.closed_at}"]
+    return [-1, "The changeset #{ex.changeset.id} was closed at #{ex.changeset.closed_at}."]
   rescue OSM::APIVersionMismatchError => ex
     # Really need to check to see whether this is a server load issue, and the 
     # last version was in the same changeset, or belongs to the same user, then
     # we can return something different
   rescue OSM::APIVersionMismatchError => ex
     # Really need to check to see whether this is a server load issue, and the 
     # last version was in the same changeset, or belongs to the same user, then
     # we can return something different
-    return [-3, "You have taken too long to edit, please reload the area"]
+    return [-3, "You have taken too long to edit, please reload the area."]
   rescue OSM::APIAlreadyDeletedError => ex
     return [-1, "The object has already been deleted"]
   rescue OSM::APIError => ex
   rescue OSM::APIAlreadyDeletedError => ex
     return [-1, "The object has already been deleted"]
   rescue OSM::APIError => ex
@@ -538,12 +538,12 @@ class AmfController < ApplicationController
           # We're creating the node
           node.create_with_history(user)
           renumberednodes[id] = node.id
           # We're creating the node
           node.create_with_history(user)
           renumberednodes[id] = node.id
-          nodeversions[id] = node.version
+          nodeversions[node.id] = node.version
         else
           # We're updating an existing node
           previous=Node.find(id)
           previous.update_from(node, user)
         else
           # We're updating an existing node
           previous=Node.find(id)
           previous.update_from(node, user)
-          nodeversions[id] = previous.version
+          nodeversions[previous.id] = previous.version
         end
       end
 
         end
       end
 
index 3e0ba9f8ef1d5c48efaf60eea3ebe118190d08b8..0b214fe720a65ad42677285defbd021b51658a39 100644 (file)
@@ -29,13 +29,13 @@ class Changeset < ActiveRecord::Base
 
   # maximum time a changeset is allowed to be open for (note that this
   # is in days - so one hour is Rational(1,24)).
 
   # maximum time a changeset is allowed to be open for (note that this
   # is in days - so one hour is Rational(1,24)).
-  MAX_TIME_OPEN = 1
+  MAX_TIME_OPEN = 1.day
 
   # 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 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)
+  IDLE_TIMEOUT = 1.hour # Rational(1,24)
 
   # Use a method like this, so that we can easily change how we
   # determine whether a changeset is open, without breaking code in at 
 
   # Use a method like this, so that we can easily change how we
   # determine whether a changeset is open, without breaking code in at 
index 21442cb121255fa2978680c0a957d04e82e970e7..6bc751f6ce548c21f487acd35cf48f65dd65bff9 100755 (executable)
Binary files a/public/potlatch/potlatch.swf and b/public/potlatch/potlatch.swf differ