]> git.openstreetmap.org Git - rails.git/commitdiff
API returns user info if public
authorSteve Coast <steve@asklater.com>
Sat, 7 Apr 2007 12:17:11 +0000 (12:17 +0000)
committerSteve Coast <steve@asklater.com>
Sat, 7 Apr 2007 12:17:11 +0000 (12:17 +0000)
app/models/node.rb
app/models/old_node.rb
app/models/old_segment.rb
app/models/old_way.rb
app/models/segment.rb
app/models/way.rb

index dfc603376b3583bd47a7e5a8d1350b6d7325561a..230b0f9a779582ff2c4ebf68dd73144434abd63d 100644 (file)
@@ -10,7 +10,6 @@ class Node < ActiveRecord::Base
   has_many :old_nodes, :foreign_key => :id
   belongs_to :user
 
-
   def self.from_xml(xml, create=false)
     p = XML::Parser.new
     p.string = xml
@@ -88,6 +87,7 @@ class Node < ActiveRecord::Base
     el1['id'] = self.id.to_s
     el1['lat'] = self.latitude.to_s
     el1['lon'] = self.longitude.to_s
+    el1['user'] = self.user.display_name if self.user.data_public?
     Node.split_tags(el1, self.tags)
     el1['visible'] = self.visible.to_s
     el1['timestamp'] = self.timestamp.xmlschema
index 7b6162d8d0e612b68a44942dd2abe326dba6daee..0bb676ef51f379c4b2177f13da96f5d148e86744 100644 (file)
@@ -20,6 +20,7 @@ class OldNode < ActiveRecord::Base
     el1['id'] = self.id.to_s
     el1['lat'] = self.latitude.to_s
     el1['lon'] = self.longitude.to_s
+    el1['user'] = self.user.display_name if self.user.data_public?
     Node.split_tags(el1, self.tags)
     el1['visible'] = self.visible.to_s
     el1['timestamp'] = self.timestamp.xmlschema
index 315f4dda76b2c06fd58fdda3c2838cc4376b99cb..7eac278fe2d78176aac3a50d47d4b6189d22cac3 100644 (file)
@@ -20,6 +20,7 @@ class OldSegment < ActiveRecord::Base
     el1['id'] = self.id.to_s
     el1['from'] = self.node_a.to_s
     el1['to'] = self.node_b.to_s
+    el1['user'] = self.user.display_name if self.user.data_public?
     Segment.split_tags(el1, self.tags)
     el1['visible'] = self.visible.to_s
     el1['timestamp'] = self.timestamp.xmlschema
index 6682c644a613b0140acdb5e3b0648b59002b57a8..4a5362bc161d486f4be84d4b7f2ef5432009dfb8 100644 (file)
@@ -81,6 +81,7 @@ class OldWay < ActiveRecord::Base
     el1['id'] = self.id.to_s
     el1['visible'] = self.visible.to_s
     el1['timestamp'] = self.timestamp.xmlschema
+    el1['user'] = self.user.display_name if self.user.data_public?
     
     self.old_segments.each do |seg| # FIXME need to make sure they come back in the right order
       e = XML::Node.new 'seg'
index cf0ec206140c19f6ada667d513906faa1ddceec1..f4909c7d2a52ed5821de3003bc42bce6eeb5f3fb 100644 (file)
@@ -82,6 +82,7 @@ class Segment < ActiveRecord::Base
     el1['id'] = self.id.to_s
     el1['from'] = self.node_a.to_s
     el1['to'] = self.node_b.to_s
+    el1['user'] = self.user.display_name if self.user.data_public?
     Segment.split_tags(el1, self.tags)
     el1['visible'] = self.visible.to_s
     el1['timestamp'] = self.timestamp.xmlschema
index d568cb026908f21ae2c05512b59a632d0fee2ec8..a6e0cecf968805958d1b36ff06601af2ad5672b8 100644 (file)
@@ -62,7 +62,7 @@ class Way < ActiveRecord::Base
     el1['id'] = self.id.to_s
     el1['visible'] = self.visible.to_s
     el1['timestamp'] = self.timestamp.xmlschema
-    
+    el1['user'] = self.user.display_name if self.user.data_public?
     # make sure segments are output in sequence_id order\r
     ordered_segments = []\r
     self.way_segments.each do |seg| \r