|
@@ -4,7 +4,7 @@ class Notification < ApplicationRecord
|
|
belongs_to :notifiable, polymorphic: true
|
|
belongs_to :notifiable, polymorphic: true
|
|
|
|
|
|
scope :unread, -> { where(read_at: nil) }
|
|
scope :unread, -> { where(read_at: nil) }
|
|
- scope :recent, -> { order(created_at: :desc) }.limit(5)
|
|
|
|
|
|
+ scope :recent, -> { order(created_at: :desc).limit(5) }
|
|
|
|
|
|
def self.post(to:, from:, action:, notifiable:)
|
|
def self.post(to:, from:, action:, notifiable:)
|
|
recipients = Array.wrap(to)
|
|
recipients = Array.wrap(to)
|