api06: Fix normal way and relation uploading (i.e. not as part of a diff).
authorGabriel Ebner <gabriel@svn.openstreetmap.org>
Mon, 5 May 2008 22:41:32 +0000 (22:41 +0000)
committerGabriel Ebner <gabriel@svn.openstreetmap.org>
Mon, 5 May 2008 22:41:32 +0000 (22:41 +0000)
(I'm sorry that I couldn't commit it earlier, but I didn't have access to an
internet connection until now.)

app/models/relation.rb
app/models/way.rb

index 559b784..58add6d 100644 (file)
@@ -17,13 +17,11 @@ class Relation < ActiveRecord::Base
       doc = p.parse
 
       doc.find('//osm/relation').each do |pt|
-       relation = Relation.from_xml_node pt, create
+       return Relation.from_xml_node(pt, create)
       end
     rescue
-      relation = nil
+      return nil
     end
-
-    return relation
   end
 
   def self.from_xml_node(pt, create=false)
index e16ec53..255f432 100644 (file)
@@ -18,13 +18,11 @@ class Way < ActiveRecord::Base
       doc = p.parse
 
       doc.find('//osm/way').each do |pt|
-       way = Way.from_xml_node pt, create
+       return Way.from_xml_node(pt, create)
       end
     rescue
-      way = nil
+      return nil
     end
-
-    return way
   end
 
   def self.from_xml_node(pt, create=false)