mirror of
https://github.com/discourse/discourse-chat-integration.git
synced 2025-03-09 14:35:34 +00:00
Smart_create_rule should only use ‘normal’ rules
This commit is contained in:
parent
16c5607fa4
commit
2251afbac0
@ -142,7 +142,7 @@ module DiscourseChat
|
||||
# :created if a new rule has been created
|
||||
# false if there was an error
|
||||
def self.smart_create_rule(channel:, filter:, category_id: nil, tags: nil)
|
||||
existing_rules = DiscourseChat::Rule.with_channel(channel)
|
||||
existing_rules = DiscourseChat::Rule.with_channel(channel).with_type('normal')
|
||||
|
||||
# Select the ones that have the same category
|
||||
same_category = existing_rules.select { |rule| rule.category_id == category_id }
|
||||
|
Loading…
x
Reference in New Issue
Block a user