X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/bed9cd00ed166ce346da4b8a9b654ddf86e64e70..b377927a6428ca30a67b2daeae48ae9bac1f851d:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index ce244fe02..85d971316 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,6 +1,8 @@ class User < ActiveRecord::Base require 'xml/libxml' + belongs_to :language, :foreign_key => 'locale' + has_many :traces has_many :diary_entries, :order => 'created_at DESC' has_many :messages, :foreign_key => :to_user_id, :order => 'sent_on DESC' @@ -30,7 +32,7 @@ class User < ActiveRecord::Base file_column :image, :magick => { :geometry => "100x100>" } def after_initialize - self.creation_time = Time.now if self.creation_time.nil? + self.creation_time = Time.now.getutc if self.creation_time.nil? end def encrypt_password @@ -113,7 +115,7 @@ class User < ActiveRecord::Base def delete self.active = false self.display_name = "user_#{self.id}" - self.description = nil + self.description = "" self.home_lat = nil self.home_lon = nil self.image = nil