classNotificationSetting<ActiveRecord::Basebelongs_to:userbelongs_to:source,polymorphic: truevalidates:user,presence: truevalidates:source,presence: truevalidates:level,presence: truevalidates:user_id,uniqueness: {scope: [:source_type,:source_id],message: "already exists in source",allow_nil: true}# Notification level# Note: When adding an option, it MUST go on the end of the array.enumlevel: [:disabled,:participating,:watch,:global,:mention]end