diff --git a/lib/carrierwave/storage/adapters/pg_connection.rb b/lib/carrierwave/storage/adapters/pg_connection.rb index 95102b4..22b901f 100644 --- a/lib/carrierwave/storage/adapters/pg_connection.rb +++ b/lib/carrierwave/storage/adapters/pg_connection.rb @@ -6,7 +6,7 @@ module PGConnection def identifier @oid ||= connection.lo_creat end - + def read @uploader.model.transaction do lo = connection.lo_open(identifier) diff --git a/spec/storage/file_spec.rb b/spec/storage/file_spec.rb index e0168ae..71e8bff 100644 --- a/spec/storage/file_spec.rb +++ b/spec/storage/file_spec.rb @@ -20,7 +20,7 @@ file.write(tempfile) file.delete } - expect { file.read }.to raise_error(PG::Error) + expect { file.read }.to raise_error(Exception) end end