Sha256: d420f8f6aebca7242b9db72fd2591b1c640aa604fccba079fa07a9c1d5e89fae
Contents?: true
Size: 831 Bytes
Versions: 46
Compression:
Stored size: 831 Bytes
Contents
# frozen_string_literal: true module Decidim class Notification < ApplicationRecord include Decidim::DataPortability belongs_to :resource, foreign_key: "decidim_resource_id", foreign_type: "decidim_resource_type", polymorphic: true belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User" def event_class_instance @event_class_instance ||= event_class.constantize.new( resource: resource, event_name: event_name, user: user, user_role: user_role, extra: extra ) end def user_role extra["received_as"] end def self.user_collection(user) where(decidim_user_id: user.id) end def self.export_serializer Decidim::DataPortabilitySerializers::DataPortabilityNotificationSerializer end end end
Version data entries
46 entries across 46 versions & 1 rubygems