From f9ec11a616ba46985ce0bfd6538c256983962282 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sat, 26 Mar 2022 12:51:29 +0100 Subject: [PATCH] Use `.class.name` for `target_type` in `Notification#make_notification` --- app/models/notification.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/notification.rb b/app/models/notification.rb index a0e91b1c..db1b9b32 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -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!