Spec for delete_lead WIP
This commit is contained in:
parent
58f130c132
commit
c2b9275e02
3 changed files with 65 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue