Revert "FEATURE: Send notification when member was accepted to group. (#7503)"

This reverts commit 42c82d544ecfe138da5b0b5a336be2109179cf26.
This commit is contained in:
Penar Musaraj
2019-05-27 15:19:59 -04:00
parent c108131ad4
commit dfcc2e7ad8
9 changed files with 14 additions and 40 deletions

View File

@ -506,20 +506,9 @@ class Group < ActiveRecord::Base
PUBLISH_CATEGORIES_LIMIT = 10
def add(user, notify: false)
def add(user)
self.users.push(user) unless self.users.include?(user)
if notify
Notification.create!(
notification_type: Notification.types[:group_invite],
user_id: user.id,
data: {
group_id: id,
group_name: name
}.to_json
)
end
if self.categories.count < PUBLISH_CATEGORIES_LIMIT
MessageBus.publish('/categories', {
categories: ActiveModel::ArraySerializer.new(self.categories).as_json