X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/b63ce5d460cf794602aa7996cdd857dc39faa3d9..fc25c3d412829774abf0454e4dcc92e41f47454c:/app/controllers/amf_controller.rb diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index ccc1259f7..9c9228a7a 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -413,13 +413,13 @@ class AmfController < ApplicationController amf_handle_error_with_timeout("'getway_old' #{id}, #{timestamp}", 'way',id) do if timestamp == '' # undelete - old_way = OldWay.where(:visible => true, :id => id).order("version DESC").first + old_way = OldWay.where(:visible => true, :way_id => id).order("version DESC").first points = old_way.get_nodes_undelete unless old_way.nil? else begin # revert timestamp = DateTime.strptime(timestamp.to_s, "%d %b %Y, %H:%M:%S") - old_way = OldWay.where("id = ? AND timestamp <= ?", id, timestamp).order("timestamp DESC").first + old_way = OldWay.where("way_id = ? AND timestamp <= ?", id, timestamp).order("timestamp DESC").first unless old_way.nil? points = old_way.get_nodes_revert(timestamp) if !old_way.visible