Use `.class.name` for `target_type` in `Notification#make_notification`

This commit is contained in:
Karina Kwiatek 2022-03-26 12:51:29 +01:00 committed by Karina Kwiatek
parent f20e407cc3
commit f9ec11a616
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ class Notification < ApplicationRecord
def make_notification(recipient, target, notification_type)
n = notification_type.new(target: target,
target_type: target.type, # To ensure we don't get a type of 'Appenddable'
target_type: target.class.name, # To ensure we don't get a type of 'Appenddable'
recipient: recipient,
new: true)
n.save!