Skip to content

Commit 61fa0db

Browse files
committed
Replace match? with match for backwards compatibility with Ruby 2.3
1 parent ce8acc9 commit 61fa0db

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/models/channel.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def data_valid?
4141

4242
data.each do |key, value|
4343
regex_string = params.find{|p| p[:key] == key}[:regex]
44-
if !Regexp.new(regex_string).match?(value)
44+
if !Regexp.new(regex_string).match(value)
4545
errors.add(:data, "data.#{key} is invalid")
4646
end
4747

spec/models/channel_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
end
7979

8080
it 'disallows invalid data' do
81-
channel2 = DiscourseChat::Channel.new(provider:"dummy2", data:{val:''})
81+
channel2 = DiscourseChat::Channel.new(provider:"dummy2", data:{val:' '})
8282
expect(channel2.valid?).to eq(false)
8383
end
8484

0 commit comments

Comments
 (0)