From 4703250c1fd02599b4c8cd0d65880ea1b6af64b4 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 23 Aug 2017 16:31:47 +0100 Subject: [PATCH] Only check channel uniqueness within the same provider --- app/models/channel.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/channel.rb b/app/models/channel.rb index 49795cc..7966a4e 100644 --- a/app/models/channel.rb +++ b/app/models/channel.rb @@ -37,7 +37,7 @@ class DiscourseChat::Channel < DiscourseChat::PluginModel end check_unique = false - matching_channels = DiscourseChat::Channel.where.not(id: id) + matching_channels = DiscourseChat::Channel.with_provider(provider).where.not(id: id) data.each do |key, value| regex_string = params.find { |p| p[:key] == key }[:regex]