Commit a224f7b1 authored by Daniel Gerhardt's avatar Daniel Gerhardt

Restore Ruby 2.3 compatibility

* Use match instead match?
parent 7b9988c5
......@@ -30,7 +30,7 @@ class Gitlab::Seeder::Environments
def create_merge_request_review_deployments!
@project
.merge_requests
.select { |mr| mr.source_branch.match?(/[a-zA-Z0-9]+/) }
.select { |mr| mr.source_branch.match(/[a-zA-Z0-9]+/) }
.sample(4)
.each do |merge_request|
next unless merge_request.diff_head_sha
......
......@@ -96,7 +96,7 @@ module Gitlab
# Calling route_hash may be expensive. Only do it if we think there's a possible match
unless request.path.end_with?('/info/lfs/objects/batch',
'/info/lfs/locks', '/info/lfs/locks/verify') ||
%r{/info/lfs/locks/\d+/unlock\z}.match?(request.path)
%r{/info/lfs/locks/\d+/unlock\z}.match(request.path)
return false
end
......
......@@ -753,7 +753,7 @@ describe Ci::Build do
it "executes UPDATE query" do
recorded = ActiveRecord::QueryRecorder.new { subject }
expect(recorded.log.select { |l| l.match?(/UPDATE.*ci_builds/) }.count).to eq(1)
expect(recorded.log.select { |l| l.match(/UPDATE.*ci_builds/) }.count).to eq(1)
end
end
......@@ -761,7 +761,7 @@ describe Ci::Build do
it 'does not execute UPDATE query' do
recorded = ActiveRecord::QueryRecorder.new { subject }
expect(recorded.log.select { |l| l.match?(/UPDATE.*ci_builds/) }.count).to eq(0)
expect(recorded.log.select { |l| l.match(/UPDATE.*ci_builds/) }.count).to eq(0)
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment