From 051e6be7b8e856eb6cef1ce54b097a00ababf45f Mon Sep 17 00:00:00 2001 From: Mark VanLandingham Date: Mon, 27 Apr 2020 15:13:34 -0500 Subject: [PATCH] DEV: Trigger 'user_added_to_group' when accepting invite with groups (#9561) --- app/models/invite_redeemer.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/invite_redeemer.rb b/app/models/invite_redeemer.rb index 172e06f3a71..d4e9392f936 100644 --- a/app/models/invite_redeemer.rb +++ b/app/models/invite_redeemer.rb @@ -124,6 +124,7 @@ InviteRedeemer = Struct.new(:invite, :username, :name, :password, :user_custom_f new_group_ids = invite.groups.pluck(:id) - invited_user.group_users.pluck(:group_id) new_group_ids.each do |id| invited_user.group_users.create(group_id: id) + DiscourseEvent.trigger(:user_added_to_group, invited_user, Group.find_by(id: id), automatic: false) end end