Skip to content

Commit

Permalink
Do not try to load adapter that is already loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasfed committed Dec 19, 2024
1 parent 27344cf commit 97ec305
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ def establish_adapter(adapter)
raise AdapterNotSpecified.new('database configuration does not specify adapter') unless adapter
raise AdapterNotFound.new('database pool must specify adapters') if adapter == 'seamless_database_pool'

adapter_method = "#{adapter}_connection"
return if respond_to?(adapter_method)

begin
require 'rubygems'
gem "activerecord-#{adapter}-adapter"
Expand All @@ -65,7 +68,6 @@ def establish_adapter(adapter)
end
end

adapter_method = "#{adapter}_connection"
return if respond_to?(adapter_method)

raise AdapterNotFound, "database configuration specifies nonexistent #{adapter} adapter"
Expand Down

0 comments on commit 97ec305

Please sign in to comment.