Skip to content

Commit

Permalink
Replaced remaining instances of connection
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Oct 7, 2024
1 parent 29189ab commit 5db4b3f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/neighbor/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def self.neighbor_attributes
if operator == "BIT_COUNT"
"BIT_COUNT(#{quoted_attribute} ^ #{query})"
else
"DISTANCE(#{quoted_attribute}, #{query}, #{connection.quote(operator)})"
"DISTANCE(#{quoted_attribute}, #{query}, #{connection_pool.with_connection { |c| c.quote(operator) }})"
end
else
if operator == "#"
Expand Down
2 changes: 1 addition & 1 deletion lib/neighbor/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def self.adapter(model)
when /sqlite/i
:sqlite
when /mysql|trilogy/i
model.connection.try(:mariadb?) ? :mariadb : :mysql
model.connection_pool.with_connection { |c| c.try(:mariadb?) } ? :mariadb : :mysql
else
:postgresql
end
Expand Down

0 comments on commit 5db4b3f

Please sign in to comment.