Skip to content

Commit d1eade0

Browse files
committed
Fix connection deprecation warning
Closes #84
1 parent cb751ba commit d1eade0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/prosopite.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,12 @@ def create_notifications
144144
end
145145

146146
def fingerprint(query)
147-
db_adapter = ActiveRecord::Base.connection.adapter_name.downcase
147+
conn = if ActiveRecord::Base.respond_to?(:lease_connection)
148+
ActiveRecord::Base.lease_connection
149+
else
150+
ActiveRecord::Base.connection
151+
end
152+
db_adapter = conn.adapter_name.downcase
148153
if db_adapter.include?('mysql') || db_adapter.include?('trilogy')
149154
mysql_fingerprint(query)
150155
else

0 commit comments

Comments
 (0)