Build trilogy adapter with newer API

Prior to this commit we were using the [older, soft-deprecated
arguments][deprecated args] to initialize a Trilogy adapter.

I don't think the [options array][] we were passing in made any sense
anyway. It becomes `@connection_options`, which Trilogy doesn't appear
to use. Trilogy expects hash args so I'm not sure how an array of args
would help us anyway. I think we were building that array for no reason.

This commit switches over to the simpler single-arg construction that
the other adapters are already using.

[deprecated args]: 4c5c904a21/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb (L128)
[options array]: 4c5c904a21/activerecord/lib/active_record/connection_adapters/trilogy_adapter.rb (L24-L32)
This commit is contained in:
Daniel Colson 2023-10-24 21:12:26 -04:00
parent 4c5c904a21
commit 571f56b6de
No known key found for this signature in database
GPG Key ID: 88A364BBE77B1353
1 changed files with 2 additions and 11 deletions

View File

@ -21,19 +21,10 @@ module ActiveRecord
# matched rather than number of rows updated.
configuration[:found_rows] = true
options = [
configuration[:host],
configuration[:port],
configuration[:database],
configuration[:username],
configuration[:password],
configuration[:socket],
0
]
trilogy_adapter_class.new nil, logger, options, configuration
trilogy_adapter_class.new(configuration)
end
end
module ConnectionAdapters
class TrilogyAdapter < AbstractMysqlAdapter
ER_BAD_DB_ERROR = 1049