Class: Decidim::EventPublisherJob
- Inherits:
-
ApplicationJob
- Object
- ActiveJob::Base
- ApplicationJob
- Decidim::EventPublisherJob
- Defined in:
- decidim-core/app/jobs/decidim/event_publisher_job.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'decidim-core/app/jobs/decidim/event_publisher_job.rb', line 7 def data @data end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
7 8 9 |
# File 'decidim-core/app/jobs/decidim/event_publisher_job.rb', line 7 def resource @resource end |
Instance Method Details
#perform(event_name, data) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'decidim-core/app/jobs/decidim/event_publisher_job.rb', line 9 def perform(event_name, data) @resource = data[:resource] @data = data return unless data[:force_send] || notifiable? if event_type.include?(:email) EmailNotificationGeneratorJob.perform_later( event_name, data[:event_class], data[:resource], data[:followers], data[:affected_users], data[:extra] ) end return unless event_type.include?(:notification) NotificationGeneratorJob.perform_later( event_name, data[:event_class], data[:resource], data[:followers], data[:affected_users], data[:extra] ) end |