瀏覽代碼

Update notification.rb

Chris Oliver 6 年之前
父節點
當前提交
43ba3d16f2
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/models/notification.rb

+ 1 - 1
app/models/notification.rb

@@ -4,7 +4,7 @@ class Notification < ApplicationRecord
   belongs_to :notifiable, polymorphic: true
   
   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:)
     recipients = Array.wrap(to)