Remove eager load from notifications
Unsure of how this managed to work before but eager loading polymorphic associations is not possible in this way.
This commit is contained in:
parent
14379acbd3
commit
b93453dee4
|
@ -11,11 +11,11 @@ class Notification < ApplicationRecord
|
|||
define_cursor_paginator :cursored_for_type, :for_type
|
||||
|
||||
def for(recipient, **kwargs)
|
||||
where(kwargs.merge!(recipient:)).includes(:target).order(:created_at).reverse_order
|
||||
where(kwargs.merge!(recipient:)).order(:created_at).reverse_order
|
||||
end
|
||||
|
||||
def for_type(recipient, type, **kwargs)
|
||||
where(kwargs.merge!(recipient:)).includes(:target).where(type:).order(:created_at).reverse_order
|
||||
where(kwargs.merge!(recipient:)).where(type:).order(:created_at).reverse_order
|
||||
end
|
||||
|
||||
def notify(recipient, target)
|
||||
|
|
Loading…
Reference in New Issue