Prepare to add Mailbluster update name

This commit is contained in:
CactusPuppy 2021-03-31 21:28:12 -07:00
parent 1d89bbd59c
commit 98a40889a8
No known key found for this signature in database
GPG key ID: 4B33B0A3E15E2C82

View file

@ -88,6 +88,7 @@ class User < ApplicationRecord
# changes from a commit (app/models/concerns/track_saved_changes.rb)
# See https://github.com/ccmcbeck/after-commit
after_update_commit :mailbluster_update_email, if: ->(obj){ obj.saved_changes.key? 'email' }
after_update_commit :mailbluster_update_name, if: ->(obj){ obj.saved_changes.key? 'name' }
# 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)}
@ -394,6 +395,10 @@ class User < ApplicationRecord
MailblusterEditLeadJob.perform_later(self, old_email: saved_changes['email'][0])
end
def mailbluster_update_name
# TODO
end
def touch_events
event_users.each(&:touch)
end