Skip to content

Commit fdaadc9

Browse files
committed
Fix issues where the driver didn't load the postgres adapter
1 parent a3b4fb3 commit fdaadc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

db/migrate/20230526212613_convert_to_active_storage.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def up
1111
else
1212
'LASTVAL()'
1313
end
14-
get_blob_id = 'LAST_INSERT_ROWID()' if conn.is_a?(SQLite3::Database)
15-
if conn.is_a?(::PG::Connection)
14+
get_blob_id = 'LAST_INSERT_ROWID()' if Object.const_defined?("SQLite3") && conn.is_a?(SQLite3::Database)
15+
if Object.const_defined?("PG") && conn.is_a?(::PG::Connection)
1616
get_blob_id = 'LASTVAL()'
1717
conn.prepare('active_storage_blobs', <<-SQL)
1818
INSERT INTO active_storage_blobs (

0 commit comments

Comments
 (0)