X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b7b2b502cf2b119208e3c1f79e4a4e38cc0edcc5..721dd9c27d299455b9159457a095716f797389f1:/app/models/user.rb 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