summaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-19 22:28:43 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-19 22:28:43 +0000
commitdeb182337d14872c5481059382459f5c21502162 (patch)
treea46bb4e773e77ae63be280e31c2ac949507d1d6b /app/models/user.rb
parenta1f3497ec46881753fc13d25c3cd2cb344ae27d8 (diff)
downloadredmine-deb182337d14872c5481059382459f5c21502162.tar.gz
redmine-deb182337d14872c5481059382459f5c21502162.zip
* Added time zone support: users can select their time zone on their account view.
* Updated Polish translation (Mariusz Olejnik). * Fixed: Projects should be listed with case mixed. git-svn-id: http://redmine.rubyforge.org/svn/trunk@917 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 9c8d1d9a3..2543bed19 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -130,6 +130,10 @@ class User < ActiveRecord::Base
self.preference ||= UserPreference.new(:user => self)
end
+ def time_zone
+ self.pref.time_zone.nil? ? nil : TimeZone[self.pref.time_zone]
+ end
+
# Return user's RSS key (a 40 chars long string), used to access feeds
def rss_key
token = self.rss_token || Token.create(:user => self, :action => 'feeds')
@@ -231,6 +235,10 @@ class AnonymousUser < User
false
end
+ def time_zone
+ nil
+ end
+
# Anonymous user has no RSS key
def rss_key
nil