mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-17 22:42:22 +08:00
enables notification to be extended
This commit is contained in:
parent
dec08c47cf
commit
3c9bd6f511
2 changed files with 5 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue