]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user.rb
resync from rails_port 11795:12304
[rails.git] / app / models / user.rb
index 0eddb259d01213506df8aa502aa71076b0a669aa..ce244fe02448bce114dbb79d25b6a009a4848f28 100644 (file)
@@ -110,4 +110,17 @@ class User < ActiveRecord::Base
     return self.preferences.find(:first, :conditions => {:k => "gps.trace.public", :v => "default"})
   end
 
+  def delete
+    self.active = false
+    self.display_name = "user_#{self.id}"
+    self.description = nil
+    self.home_lat = nil
+    self.home_lon = nil
+    self.image = nil
+    self.email_valid = false
+    self.new_email = nil
+    self.visible = false
+    self.save
+  end
+
 end