We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
match?
match
1 parent ce8acc9 commit 61fa0dbCopy full SHA for 61fa0db
app/models/channel.rb
@@ -41,7 +41,7 @@ def data_valid?
41
42
data.each do |key, value|
43
regex_string = params.find{|p| p[:key] == key}[:regex]
44
- if !Regexp.new(regex_string).match?(value)
+ if !Regexp.new(regex_string).match(value)
45
errors.add(:data, "data.#{key} is invalid")
46
end
47
spec/models/channel_spec.rb
@@ -78,7 +78,7 @@
78
79
80
it 'disallows invalid data' do
81
- channel2 = DiscourseChat::Channel.new(provider:"dummy2", data:{val:''})
+ channel2 = DiscourseChat::Channel.new(provider:"dummy2", data:{val:' '})
82
expect(channel2.valid?).to eq(false)
83
84
0 commit comments