]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user.rb
resync from rails_port 11795:12304
[rails.git] / app / models / user.rb
index ecf41fd18fb827d4f56aee783416db627205f5f5..ce244fe02448bce114dbb79d25b6a009a4848f28 100644 (file)
@@ -106,4 +106,21 @@ class User < ActiveRecord::Base
     return false
   end
 
+  def trace_public_default
+    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