Class: Decidim::Notification

Inherits:
ApplicationRecord show all
Includes:
DownloadYourData
Defined in:
app/models/decidim/notification.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.export_serializerObject



40
41
42
# File 'app/models/decidim/notification.rb', line 40

def self.export_serializer
  Decidim::DownloadYourDataSerializers::DownloadYourDataNotificationSerializer
end

.user_collection(user) ⇒ Object



36
37
38
# File 'app/models/decidim/notification.rb', line 36

def self.user_collection(user)
  where(decidim_user_id: user.id)
end

Instance Method Details

#event_class_instanceObject



22
23
24
25
26
27
28
29
30
# File 'app/models/decidim/notification.rb', line 22

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

#user_roleObject



32
33
34
# File 'app/models/decidim/notification.rb', line 32

def user_role
  extra["received_as"]
end