summaryrefslogtreecommitdiffstats
path: root/app/models/user_preference.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-12-13 15:21:48 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-12-13 15:21:48 +0000
commitad8a529c8dbef45a499b262134c501d014ccab5e (patch)
tree4703f4ef8888b3ded6f236486b587cb1588cb63c /app/models/user_preference.rb
parent46e1c6a2fea707a07f93c212f4f36b0f407c802e (diff)
downloadredmine-ad8a529c8dbef45a499b262134c501d014ccab5e.tar.gz
redmine-ad8a529c8dbef45a499b262134c501d014ccab5e.zip
Option to show email adresses by default for new users (#21447).
git-svn-id: http://svn.redmine.org/redmine/trunk@14974 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/user_preference.rb')
-rw-r--r--app/models/user_preference.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/user_preference.rb b/app/models/user_preference.rb
index 80b3e6b9d..6e7876abb 100644
--- a/app/models/user_preference.rb
+++ b/app/models/user_preference.rb
@@ -25,6 +25,9 @@ class UserPreference < ActiveRecord::Base
def initialize(attributes=nil, *args)
super
+ if new_record? && !(attributes && attributes.key?(:hide_mail))
+ self.hide_mail = Setting.default_users_hide_mail?
+ end
self.others ||= {}
end