X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/b9ae40d9784725b75e5b52f55659c80326656d8f..8ad1ce97983a5d4fb86ccb8ee4cd640a76f95255:/app/controllers/api/ways_controller.rb diff --git a/app/controllers/api/ways_controller.rb b/app/controllers/api/ways_controller.rb index 102be29bd..0871384a7 100644 --- a/app/controllers/api/ways_controller.rb +++ b/app/controllers/api/ways_controller.rb @@ -22,13 +22,11 @@ module Api end def show - way = Way.find(params[:id]) - - response.last_modified = way.timestamp + @way = Way.find(params[:id]) - if way.visible - @way = way + response.last_modified = @way.timestamp + if @way.visible # Render the result respond_to do |format| format.xml @@ -64,22 +62,20 @@ module Api end def full - way = Way.includes(:nodes => :node_tags).find(params[:id]) + @way = Way.includes(:nodes => :node_tags).find(params[:id]) - if way.visible + if @way.visible visible_nodes = {} @nodes = [] - way.nodes.uniq.each do |node| + @way.nodes.uniq.each do |node| if node.visible @nodes << node visible_nodes[node.id] = node end end - @way = way - # Render the result respond_to do |format| format.xml