Spec for delete_lead WIP

This commit is contained in:
Ziyi 2021-03-23 13:45:05 -07:00 committed by CactusPuppy
parent 58f130c132
commit c2b9275e02
No known key found for this signature in database
GPG key ID: 4B33B0A3E15E2C82
3 changed files with 65 additions and 3 deletions

View file

@ -81,6 +81,7 @@ class User < ApplicationRecord
after_save :touch_events
after_commit :mailbluster_create_lead, on: :create
after_commit :mailbluster_delete_lead, on: :destroy
# add scope
scope :comment_notifiable, ->(conference) {joins(:roles).where('roles.name IN (?)', [:organizer, :cfp]).where('roles.resource_type = ? AND roles.resource_id = ?', 'Conference', conference.id)}
@ -378,6 +379,10 @@ class User < ApplicationRecord
ApplicationController.helpers.create_lead(self)
end
def mailbluster_delete_lead
ApplicationController.helpers.delete_lead(self)
end
def touch_events
event_users.each(&:touch)
end