Skip to content

Commit 571f56b

Browse files
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]: https://github.com/rails/rails/blob/4c5c904a212a850c43adb7a3c3a719ca3d2b9159/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L128 [options array]: https://github.com/rails/rails/blob/4c5c904a212a850c43adb7a3c3a719ca3d2b9159/activerecord/lib/active_record/connection_adapters/trilogy_adapter.rb#L24-L32
1 parent 4c5c904 commit 571f56b

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

activerecord/lib/active_record/connection_adapters/trilogy_adapter.rb

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,10 @@ def trilogy_connection(config)
2121
# matched rather than number of rows updated.
2222
configuration[:found_rows] = true
2323

24-
options = [
25-
configuration[:host],
26-
configuration[:port],
27-
configuration[:database],
28-
configuration[:username],
29-
configuration[:password],
30-
configuration[:socket],
31-
0
32-
]
33-
34-
trilogy_adapter_class.new nil, logger, options, configuration
24+
trilogy_adapter_class.new(configuration)
3525
end
3626
end
27+
3728
module ConnectionAdapters
3829
class TrilogyAdapter < AbstractMysqlAdapter
3930
ER_BAD_DB_ERROR = 1049

0 commit comments

Comments
 (0)