]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api_controller.rb
api fixes
[rails.git] / app / controllers / api_controller.rb
index 1eda437010c88ff2c9a2faf913fd7e9cd822d611..35a0f25b75a2332308b3c1856aef2e3d72e03aa4 100644 (file)
@@ -9,10 +9,6 @@ class ApiController < ApplicationController
   #COUNT is the number of map requests to allow before exiting and starting a new process
   @@count = COUNT
 
-  def authorize_web
-    @current_user = User.find_by_token(session[:token])
-  end
-
   # The maximum area you're allowed to request, in square degrees
   MAX_REQUEST_AREA = 0.25
 
@@ -201,7 +197,8 @@ class ApiController < ApplicationController
 
     end
 
-    segments_to_fetch = list_of_way_segments.uniq - segment_ids
+    # - [0] in case some thing links to segment 0 which doesn't exist. Shouldn't actually ever happen but it does. FIXME: file a ticket for this
+    segments_to_fetch = (list_of_way_segments.uniq - segment_ids) - [0]
 
     if segments_to_fetch.length > 0
       segments += Segment.find(segments_to_fetch)