Replace match? with match for backwards compatibility with Ruby 2.3
This commit is contained in:
@@ -41,7 +41,7 @@ class DiscourseChat::Channel < DiscourseChat::PluginModel
|
||||
|
||||
data.each do |key, value|
|
||||
regex_string = params.find{|p| p[:key] == key}[:regex]
|
||||
if !Regexp.new(regex_string).match?(value)
|
||||
if !Regexp.new(regex_string).match(value)
|
||||
errors.add(:data, "data.#{key} is invalid")
|
||||
end
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ RSpec.describe DiscourseChat::Channel do
|
||||
end
|
||||
|
||||
it 'disallows invalid data' do
|
||||
channel2 = DiscourseChat::Channel.new(provider:"dummy2", data:{val:''})
|
||||
channel2 = DiscourseChat::Channel.new(provider:"dummy2", data:{val:' '})
|
||||
expect(channel2.valid?).to eq(false)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user