diaspora/app/models/user_preference.rb
Lukas Matt 26d0c81dae Added the ability to disable report-email-notification
Podmin can see a extra checkbox in Settings > Account
for disabling report-email-notification
2014-05-15 07:23:43 -04:00

21 lines
469 B
Ruby

class UserPreference < ActiveRecord::Base
belongs_to :user
validate :must_be_valid_email_type
VALID_EMAIL_TYPES =
["someone_reported",
"mentioned",
"comment_on_post",
"private_message",
"started_sharing",
"also_commented",
"liked",
"reshared"]
def must_be_valid_email_type
unless VALID_EMAIL_TYPES.include?(self.email_type)
errors.add(:email_type, 'supplied mail type is not a valid or known email type')
end
end
end