retrospring/app/controllers/notifications_controller.rb
2014-12-14 15:24:59 +01:00

12 lines
376 B
Ruby

class NotificationsController < ApplicationController
before_filter :authenticate_user!
def index
@type = params[:type]
@notifications = if @type == 'all'
Notification.for(current_user)
else
Notification.for(current_user).where('LOWER(target_type) = ?', @type)
end
end
end