mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 12:13:58 -06:00
FIX: only add user to invited groups once
This commit is contained in:
parent
cbe18eb0df
commit
9981257880
@ -88,8 +88,9 @@ InviteRedeemer = Struct.new(:invite, :username, :name) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def add_user_to_groups
|
def add_user_to_groups
|
||||||
invite.groups.each do |g|
|
new_group_ids = invite.groups.pluck(:id) - invited_user.group_users.pluck(:group_id)
|
||||||
invited_user.group_users.create(group_id: g.id)
|
new_group_ids.each do |id|
|
||||||
|
invited_user.group_users.create(group_id: id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user