X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b7b2b502cf2b119208e3c1f79e4a4e38cc0edcc5..b823e9fccca6072d92cc4f1ba0d1850488a5f3c4:/app/models/user.rb?ds=sidebyside diff --git a/app/models/user.rb b/app/models/user.rb index ecf41fd18..ce244fe02 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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