Include conditional for adding tag mods to connect channel (#1366)
* fix slug typo * fix specs * use blank? instead of nil?
This commit is contained in:
parent
c2a85540f0
commit
1586d9fd7d
2 changed files with 3 additions and 1 deletions
|
|
@ -4,7 +4,9 @@ module AssignTagModerator
|
|||
user = User.find(user_id)
|
||||
tag = Tag.find_by(name: tag_names[index])
|
||||
user.add_role(:tag_moderator, tag)
|
||||
ChatChannel.find_by(slug: "tag-moderators").add_users(user)
|
||||
if user.chat_channels.find_by(slug: "tag-moderators").blank?
|
||||
ChatChannel.find_by(slug: "tag-moderators").add_users(user)
|
||||
end
|
||||
NotifyMailer.tag_moderator_confirmation_email(user, tag.name).deliver unless tag.name == "go"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
0
environment
Normal file
0
environment
Normal file
Loading…
Add table
Reference in a new issue