From: Richard Fairhurst Date: Thu, 18 Dec 2008 00:32:02 +0000 (+0000) Subject: Potlatch for API 0.6 now saving ways happily with node versioning... I think X-Git-Tag: live~8182^2~87 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/2b8bde9055f0cfdf7d261382cd40980d72bae188 Potlatch for API 0.6 now saving ways happily with node versioning... I think --- diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index b6e3bf351..80472fe25 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -458,12 +458,12 @@ class AmfController < ApplicationController 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 - 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 @@ -538,12 +538,12 @@ class AmfController < ApplicationController # 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) - nodeversions[id] = previous.version + nodeversions[previous.id] = previous.version end end diff --git a/app/models/changeset.rb b/app/models/changeset.rb index 3e0ba9f8e..0b214fe72 100644 --- a/app/models/changeset.rb +++ b/app/models/changeset.rb @@ -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)). - 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 = 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 diff --git a/public/potlatch/potlatch.swf b/public/potlatch/potlatch.swf index 21442cb12..6bc751f6c 100755 Binary files a/public/potlatch/potlatch.swf and b/public/potlatch/potlatch.swf differ