Class: UserPreference

Inherits:
ApplicationRecord show all
Defined in:
app/models/user_preference.rb

Constant Summary collapse

VALID_EMAIL_TYPES =
["someone_reported",
"mentioned",
"mentioned_in_comment",
"comment_on_post",
"private_message",
"started_sharing",
"also_commented",
"liked",
"reshared",
"contacts_birthday"]

Instance Method Summary collapse

Instance Method Details

#must_be_valid_email_typeObject


20
21
22
23
24
# File 'app/models/user_preference.rb', line 20

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