Skip to content

Commit af9c910

Browse files
committed
start_with? allows multiple prefix values
1 parent 58ccc09 commit af9c910

File tree

1 file changed

+1
-1
lines changed
  • activerecord/lib/active_record/database_configurations

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/database_configurations/url_config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def initialize(env_name, name, url, configuration_hash = {})
4242
# Return a Hash that can be merged into the main config that represents
4343
# the passed in url
4444
def build_url_hash
45-
if url.nil? || %w(jdbc: http: https:).any? { |protocol| url.start_with?(protocol) }
45+
if url.nil? || url.start_with?("jdbc:", "http:", "https:")
4646
{ url: url }
4747
else
4848
ConnectionUrlResolver.new(url).to_hash

0 commit comments

Comments
 (0)