diaspora/app/models/user_preference.rb
Ilya Zhitomirskiy 6cda0bf9ea Revert "added a podwide email preference"
This reverts commit 60c0a9839b.
2011-05-18 10:38:45 -07:00

19 lines
431 B
Ruby

class UserPreference < ActiveRecord::Base
belongs_to :user
validate :must_be_valid_email_type
VALID_EMAIL_TYPES =
["mentioned",
"comment_on_post",
"private_message",
"started_sharing",
"also_commented",
"liked"]
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