1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

start_with? allows multiple prefix values

This commit is contained in:
Ryuta Kamizono 2021-01-23 16:43:01 +09:00
parent 58ccc09d83
commit af9c910db7

View file

@ -42,7 +42,7 @@ module ActiveRecord
# Return a Hash that can be merged into the main config that represents
# the passed in url
def build_url_hash
if url.nil? || %w(jdbc: http: https:).any? { |protocol| url.start_with?(protocol) }
if url.nil? || url.start_with?("jdbc:", "http:", "https:")
{ url: url }
else
ConnectionUrlResolver.new(url).to_hash