Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,17 @@ class User < Principal
end
end)

def mail_notification
notification = read_attribute(:mail_notification)
if MAIL_NOTIFICATION_OPTIONS.any? { |option_value, _label| option_value == notification }
notification
else
'none'
end
end

def set_mail_notification
self.mail_notification = Setting.default_notification_option if self.mail_notification.blank?
self.mail_notification = Setting.default_notification_option if self[:mail_notification].blank?
true
end

Expand Down
Loading