浏览代码

Scope notifications controller to the current user

Chris Oliver 6 年之前
父节点
当前提交
dcd6ae54a5
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/controllers/notifications_controller.rb

+ 1 - 1
app/controllers/notifications_controller.rb

@@ -2,6 +2,6 @@ class NotificationsController < ApplicationController
   before_action :authenticate_user!
 
   def index
-    @notifications = Notification.where(recipient: current_user)
+    @notifications = current_user.notifications
   end
 end