Create Houdini::FullContact::FullContactListener and set up
This commit is contained in:
parent
238eba4a50
commit
f7e33f85aa
3 changed files with 12 additions and 1 deletions
|
@ -0,0 +1,5 @@
|
|||
module Houdini::FullContact::FullContactListener
|
||||
def supporter_create(supporter)
|
||||
Houdini::FullContact::InsertInfos.enqueue(supporter.id)
|
||||
end
|
||||
end
|
|
@ -0,0 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
||||
Rails.application.config.houdini.listeners << Houdini::FullContact::FullContactListener
|
|
@ -163,7 +163,9 @@ module InsertImport
|
|||
.where(id: import['id'])
|
||||
.returning('*')
|
||||
.execute.first
|
||||
Houdini::FullContact::InsertInfos.enqueue(supporter_ids) if supporter_ids.any?
|
||||
Supporter.where("supporter.ids IN (?)", supporter_ids).each do |s|
|
||||
Houdini.event_publisher.announce(:supporter_create, s)
|
||||
end
|
||||
ImportCompletedJob.perform_later(Import.find(import['id']))
|
||||
import
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue