소스 검색

Scope notifications controller to the current user

Chris Oliver 7 년 전
부모
커밋
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