@@ -36,14 +36,16 class UserPreference < ActiveRecord::Base | |||
|
36 | 36 | |
|
37 | 37 | def initialize(attributes=nil, *args) |
|
38 | 38 | super |
|
39 | if new_record? && !(attributes && attributes.key?(:hide_mail)) | |
|
40 | self.hide_mail = Setting.default_users_hide_mail? | |
|
41 | end | |
|
42 | if new_record? && !(attributes && attributes.key?(:time_zone)) | |
|
43 | self.time_zone = Setting.default_users_time_zone | |
|
44 | end | |
|
45 | if new_record? && !(attributes && attributes.key?(:no_self_notified)) | |
|
46 | self.no_self_notified = true | |
|
39 | if new_record? | |
|
40 | unless attributes && attributes.key?(:hide_mail) | |
|
41 | self.hide_mail = Setting.default_users_hide_mail? | |
|
42 | end | |
|
43 | unless attributes && attributes.key?(:time_zone) | |
|
44 | self.time_zone = Setting.default_users_time_zone | |
|
45 | end | |
|
46 | unless attributes && attributes.key?(:no_self_notified) | |
|
47 | self.no_self_notified = true | |
|
48 | end | |
|
47 | 49 | end |
|
48 | 50 | self.others ||= {} |
|
49 | 51 | end |
General Comments 0
You need to be logged in to leave comments.
Login now