Try if notifiable has notifiable methods
Why: There are Notifications with associated `notifiables` that actually are not anymore Notifiables (the class doesn't include the Notifiable concern). So when Notification delegates certain "notifiable" methods to them the is an error. How: Using `try` directly on the notifiable association to avoid the delegate trap on those corner case scenarios.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<li id="<%= dom_id(notification) %>" class="notification <%= 'unread' if notification&.unread? %>">
|
||||
<% if notification.try(:notifiable_available?) %>
|
||||
<% if notification.notifiable.try(:notifiable_available?) %>
|
||||
<% locals = { notification: notification,
|
||||
timestamp: notification.timestamp,
|
||||
title: notification.notifiable_title,
|
||||
|
||||
Reference in New Issue
Block a user