enables notification to be extended

This commit is contained in:
zmagod 2016-11-02 14:44:16 +01:00
parent dec08c47cf
commit 3c9bd6f511
2 changed files with 5 additions and 1 deletions

View file

@ -3,7 +3,7 @@ class Notification < ActiveRecord::Base
has_many :users, through: :user_notifications
belongs_to :generator_user, class_name: 'User'
enum type_of: [:assignment, :recent_changes, :system_message]
enum type_of: Constants::NOTIFICATIONS_TYPES
def already_seen(user)
UserNotification.where(notification: self, user: user)

View file

@ -196,6 +196,10 @@ class Constants
'text/plain'
].freeze
# Notification types. Should not be freezed, as modules might append to this.
NOTIFICATIONS_TYPES = { assignment: 0,
recent_changes: 1,
system_message: 2 }
# Organization name for default admin user
DEFAULT_PRIVATE_ORG_NAME = 'My projects'.freeze