updates to api
authorSteve Coast <steve@asklater.com>
Thu, 10 May 2007 19:37:33 +0000 (19:37 +0000)
committerSteve Coast <steve@asklater.com>
Thu, 10 May 2007 19:37:33 +0000 (19:37 +0000)
app/controllers/api_controller.rb
app/controllers/segment_controller.rb
app/models/way.rb

index 1eda437010c88ff2c9a2faf913fd7e9cd822d611..8e4004dd15652aa3bb4f1dfa5c7cf83da2f5f5fe 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
 
index c6d4ad611a7129288a8d831f76644b27f1805be2..a75ff911d703255830be5c2e30707076ee3fa054 100644 (file)
@@ -22,6 +22,7 @@ class SegmentController < ApplicationController
         
         unless segment.preconditions_ok? # are the nodes visible?
           render :nothing => true, :status => HTTP_PRECONDITION_FAILED
+          return
         end
 
         if segment.save_with_history
index 65bb3158debd3c545c47b869ed6de3c50a900ba6..090c7a739f9bf7344d237528d9460024c6550186 100644 (file)
@@ -84,7 +84,7 @@ class Way < ActiveRecord::Base
     end
 
     ordered_segments.each do |seg_id|
-      if seg_id
+      if seg_id and seg_id != '0'
         e = XML::Node.new 'seg'
         e['id'] = seg_id
         el1 << e