Called create_lead in model, FactoryBot errors
This commit is contained in:
parent
09becbc3e0
commit
f98f35ec8d
3 changed files with 66 additions and 1 deletions
|
|
@ -80,6 +80,8 @@ class User < ApplicationRecord
|
|||
|
||||
after_save :touch_events
|
||||
|
||||
after_commit :mailbluster_create_lead, on: :create
|
||||
|
||||
# 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)}
|
||||
|
||||
|
|
@ -362,6 +364,9 @@ class User < ApplicationRecord
|
|||
end
|
||||
|
||||
# TODO email_hash function for mailbluster
|
||||
# def email_hash
|
||||
# Digest::MD5.hexdigest user.email
|
||||
# end
|
||||
|
||||
private
|
||||
|
||||
|
|
@ -369,6 +374,10 @@ class User < ApplicationRecord
|
|||
self.is_admin = true if User.empty?
|
||||
end
|
||||
|
||||
def mailbluster_create_lead
|
||||
ApplicationController.helpers.create_lead(self)
|
||||
end
|
||||
|
||||
def touch_events
|
||||
event_users.each(&:touch)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue