Преглед на файлове

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