Feature: User Notification Objects (#752)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# email_flags :integer default(0), not null
|
||||
# push_flags :integer default(0), not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# account_id :integer
|
||||
@@ -25,10 +26,9 @@ class NotificationSetting < ApplicationRecord
|
||||
flag_query_mode: :bit_operator
|
||||
}.freeze
|
||||
|
||||
EMAIL_NOTIFICATION_FLAGS = {
|
||||
1 => :conversation_creation,
|
||||
2 => :conversation_assignment
|
||||
}.freeze
|
||||
EMAIL_NOTIFICATION_FLAGS = ::Notification::NOTIFICATION_TYPES.transform_keys { |key| "email_#{key}".to_sym }.invert.freeze
|
||||
PUSH_NOTIFICATION_FLAGS = ::Notification::NOTIFICATION_TYPES.transform_keys { |key| "push_#{key}".to_sym }.invert.freeze
|
||||
|
||||
has_flags EMAIL_NOTIFICATION_FLAGS.merge(column: 'email_flags').merge(DEFAULT_QUERY_SETTING)
|
||||
has_flags PUSH_NOTIFICATION_FLAGS.merge(column: 'push_flags').merge(DEFAULT_QUERY_SETTING)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user