mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Publish group's categories to user when adding user to group.
https://meta.discourse.org/t/joining-a-group-doesnt-take-effect-unless-the-browser-is-hard-refreshed/57357/11?u=tgxworld
This commit is contained in:
@@ -371,6 +371,11 @@ class Group < ActiveRecord::Base
|
||||
|
||||
def add(user)
|
||||
self.users.push(user) unless self.users.include?(user)
|
||||
|
||||
MessageBus.publish('/categories', {
|
||||
categories: ActiveModel::ArraySerializer.new(self.categories).as_json
|
||||
}, user_ids: [user.id])
|
||||
|
||||
self
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user