Ignore self when checking for duplicate rule

This commit is contained in:
David Taylor 2017-07-29 19:27:21 +01:00
parent 61fa0dbe0b
commit 28091a9a97
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ class DiscourseChat::Channel < DiscourseChat::PluginModel
end
check_unique = false
matching_channels = DiscourseChat::Channel.all
matching_channels = DiscourseChat::Channel.where.not(id: id)
data.each do |key, value|
regex_string = params.find{|p| p[:key] == key}[:regex]