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
# 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
# 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