We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c4c25e commit 3b45582Copy full SHA for 3b45582
app/models/user.rb
@@ -157,8 +157,17 @@ class User < Principal
157
end
158
end)
159
160
+ def mail_notification
161
+ notification = read_attribute(:mail_notification)
162
+ if MAIL_NOTIFICATION_OPTIONS.any? { |option_value, _label| option_value == notification }
163
+ notification
164
+ else
165
+ 'none'
166
+ end
167
168
+
169
def set_mail_notification
- self.mail_notification = Setting.default_notification_option if self.mail_notification.blank?
170
+ self.mail_notification = Setting.default_notification_option if self[:mail_notification].blank?
171
true
172
173
0 commit comments