Skip to content

Commit

Permalink
Fix connection deprecation warning
Browse files Browse the repository at this point in the history
Closes #84
  • Loading branch information
charkost committed Feb 20, 2025
1 parent cb751ba commit d1eade0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/prosopite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@ def create_notifications
end

def fingerprint(query)
db_adapter = ActiveRecord::Base.connection.adapter_name.downcase
conn = if ActiveRecord::Base.respond_to?(:lease_connection)
ActiveRecord::Base.lease_connection
else
ActiveRecord::Base.connection
end
db_adapter = conn.adapter_name.downcase
if db_adapter.include?('mysql') || db_adapter.include?('trilogy')
mysql_fingerprint(query)
else
Expand Down

0 comments on commit d1eade0

Please sign in to comment.