diff --git a/app/models/user.rb b/app/models/user.rb index 331ce805..fcfe864c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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