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:
Vinoth Kannan
2020-07-16 14:20:41 +05:30
parent 906a84d66f
commit 1460d7957c
3 changed files with 22 additions and 5 deletions

View File

@@ -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