Prepare to add Mailbluster update name
This commit is contained in:
parent
1d89bbd59c
commit
98a40889a8
1 changed files with 5 additions and 0 deletions
|
|
@ -88,6 +88,7 @@ class User < ApplicationRecord
|
||||||
# changes from a commit (app/models/concerns/track_saved_changes.rb)
|
# changes from a commit (app/models/concerns/track_saved_changes.rb)
|
||||||
# See https://github.com/ccmcbeck/after-commit
|
# 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_email, if: ->(obj){ obj.saved_changes.key? 'email' }
|
||||||
|
after_update_commit :mailbluster_update_name, if: ->(obj){ obj.saved_changes.key? 'name' }
|
||||||
|
|
||||||
# add scope
|
# 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)}
|
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])
|
MailblusterEditLeadJob.perform_later(self, old_email: saved_changes['email'][0])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def mailbluster_update_name
|
||||||
|
# TODO
|
||||||
|
end
|
||||||
|
|
||||||
def touch_events
|
def touch_events
|
||||||
event_users.each(&:touch)
|
event_users.each(&:touch)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue