Sha256: 90001fa86a5fd0ed340d0a5a58297b0d1dc7212314ebbb6a86516c4b2843073d
Contents?: true
Size: 797 Bytes
Versions: 7
Compression:
Stored size: 797 Bytes
Contents
# frozen_string_literal: true module Decidim class NotificationsCell < Decidim::ViewModel include Decidim::CellsPaginateHelper include Decidim::LayoutHelper include Decidim::Core::Engine.routes.url_helpers helper_method :notifications def show return render :validations if validation_messages.present? render :show end private def validation_messages return [] if notifications_with_resource.present? [t("decidim.notifications.no_notifications")] end def notifications_with_resource @notifications_with_resource ||= notifications.select(&:resource) end def notifications @notifications ||= model.notifications.includes(:resource).order(created_at: :desc).page(params[:page]).per(50) end end end
Version data entries
7 entries across 7 versions & 1 rubygems