Sha256: 58b3092c01bff754f71eca78373dcc2d3af529d5b8408a2fc869096886c3dcc6
Contents?: true
Size: 635 Bytes
Versions: 7
Compression:
Stored size: 635 Bytes
Contents
# frozen_string_literal: true module Decidim # The controller to handle the user's notifications deletion. class NotificationsController < Decidim::ApplicationController def destroy notification = notifications.find(params[:id]) enforce_permission_to :destroy, :notification, notification: notification notification.destroy end def read_all enforce_permission_to :destroy, :notification, notification: notifications.first notifications.destroy_all end private def notifications @notifications ||= current_user.notifications.order(created_at: :desc) end end end
Version data entries
7 entries across 7 versions & 1 rubygems