mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: trigger user_updated event if email changed.
It will trigger `user_updated` Discourse event if a user_email record is created or updated or destroyed.
This commit is contained in:
@@ -19,6 +19,10 @@ class UserEmail < ActiveRecord::Base
|
||||
|
||||
scope :secondary, -> { where(primary: false) }
|
||||
|
||||
after_commit(on: [:create, :update, :destroy]) do
|
||||
DiscourseEvent.trigger(:user_updated, user)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def strip_downcase_email
|
||||
|
||||
Reference in New Issue
Block a user