aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/connection_specification.rb
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2019-07-27 12:56:39 +0900
committerAkira Matsuda <ronnie@dio.jp>2019-07-27 13:06:49 +0900
commitd1ffe59ab5fd6e811833c127d43b32e87b5d7131 (patch)
treec866689e6b51b1f7eac9e49212d2938d56f6ecb2 /activerecord/lib/active_record/connection_adapters/connection_specification.rb
parente9651deea4145f62224af56af027bfbb3e45e4cd (diff)
downloadrails-d1ffe59ab5fd6e811833c127d43b32e87b5d7131.tar.gz
rails-d1ffe59ab5fd6e811833c127d43b32e87b5d7131.tar.bz2
rails-d1ffe59ab5fd6e811833c127d43b32e87b5d7131.zip
Use match? where we don't need MatchData
We're already running Performance/RegexpMatch cop, but it seems like the cop is not always =~ justice
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/connection_specification.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/connection_specification.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/connection_specification.rb b/activerecord/lib/active_record/connection_adapters/connection_specification.rb
index 0732b69f81..20041f0c85 100644
--- a/activerecord/lib/active_record/connection_adapters/connection_specification.rb
+++ b/activerecord/lib/active_record/connection_adapters/connection_specification.rb
@@ -275,7 +275,7 @@ module ActiveRecord
# hash and merges with the rest of the hash.
# Connection details inside of the "url" key win any merge conflicts
def resolve_hash_connection(spec)
- if spec["url"] && spec["url"] !~ /^jdbc:/
+ if spec["url"] && !spec["url"].match?(/^jdbc:/)
connection_hash = resolve_url_connection(spec.delete("url"))
spec.merge!(connection_hash)
end