X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/974e404a6e21e953354c38fc71338deb259f13ed..c441a4dc15f2de78e6c43a51a850b394a25aa5a9:/app/controllers/api/nodes/ways_controller.rb diff --git a/app/controllers/api/nodes/ways_controller.rb b/app/controllers/api/nodes/ways_controller.rb index 2a71f1903..cdbdc07d0 100644 --- a/app/controllers/api/nodes/ways_controller.rb +++ b/app/controllers/api/nodes/ways_controller.rb @@ -10,9 +10,11 @@ module Api # :node_id parameter. note that this used to return deleted ways as well, but # this seemed not to be the expected behaviour, so it was removed. def index - way_ids = WayNode.where(:node_id => params[:node_id]).collect { |ws| ws.id[0] }.uniq - - @ways = Way.where(:id => way_ids, :visible => true) + @ways = Way + .visible + .where(:id => WayNode.where( + :node_id => params[:node_id] + ).select(:way_id)) # Render the result respond_to do |format|