]> git.openstreetmap.org Git - rails.git/commitdiff
Include the home location in API user details response.
authorTom Hughes <tom@compton.nu>
Sun, 19 Aug 2007 09:43:01 +0000 (09:43 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 19 Aug 2007 09:43:01 +0000 (09:43 +0000)
app/models/user.rb

index 908ef3d517b6016287e7793661cc404462acb608..ef8e8bbf70aca4a2215a6cf7758fac913d7b2e54 100644 (file)
@@ -58,6 +58,13 @@ class User < ActiveRecord::Base
     el1 = XML::Node.new 'user'
     el1['display_name'] = self.display_name.to_s
     el1['account_created'] = self.creation_time.xmlschema
+    if self.home_lat and self.home_lon
+      home = XML::Node.new 'home'
+      home['lat'] = self.home_lat.to_s
+      home['lon'] = self.home_lon.to_s
+      home['zoom'] = self.home_zoom.to_s
+      el1 << home
+    end
     return el1
   end