Skip to content

Commit

Permalink
fix: avoid WARNING: there is no transaction in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
isqad committed Apr 28, 2022
1 parent b223770 commit ec9deb6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions lib/treasury/storage/postgre_sql/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ module PostgreSQL
#
module Base
def start_transaction
return if transaction_started?
return unless connection.transaction_open?
return if transaction_started? || connection.transaction_open?

internal_start_transaction
super
Expand Down
1 change: 0 additions & 1 deletion spec/lib/treasury/storage/postgre_sql/db_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

context 'when shared' do
it do
expect(connection).to receive(:execute).ordered.with('BEGIN')
expect(connection).to receive(:execute).ordered.with('LOCK TABLE "test_table" IN SHARE MODE')
expect { storage.lock }.not_to raise_error
end
Expand Down

0 comments on commit ec9deb6

Please sign in to comment.