pg_conn 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d29017a92f97bb843ada8a10d00ab0a130e0e572e9775f21ddacb9f6d9ca4e66
4
- data.tar.gz: e56a31694ec01c3ef15ae35b1f5a28304dad179a918c69a687e08fb267f1b30e
3
+ metadata.gz: ca254f7c17749713f46f07448221683e5975c570407aff61ee440f82a37466ca
4
+ data.tar.gz: 86486e52477bbf36009d69f9322061077b5860582e4fc7ced67e2d88bad5ee0b
5
5
  SHA512:
6
- metadata.gz: a920f75a6d118bdc44e5442adbe38e6ecbc6872ac010f3c29390a25db4e95605541d4bc1dd67a0f7ac1332611119d983211aaff1acda885aca07ed1a464705a7
7
- data.tar.gz: 4339f922abbdeb6db692a8906a5c5fea4aa21a645be69df90a39473cc2453c9f79c684b8b2e69996a343cc368dcaeaecc960154dbcc78003ec230bd3605363ad
6
+ metadata.gz: b0981561372e9039eda5c8eb85948c63559e1875f4764dfaa3b32d52fa501b62522b2acde9a58036aa6978bb9b454cb66bec788e9d141dbc50b3ce5e14ee9941
7
+ data.tar.gz: 70a3927ceec9d61962002e301c817479e043878ec122ed1d265c9ed9372fb0abc744eaaf266e983b6352179f42e983752c030a12e878699c24b37fde8c6c663e
@@ -1,3 +1,3 @@
1
1
  module PgConn
2
- VERSION = "0.14.0"
2
+ VERSION = "0.15.0"
3
3
  end
data/lib/pg_conn.rb CHANGED
@@ -700,18 +700,21 @@ module PgConn
700
700
  end
701
701
  end
702
702
 
703
- def pop_transaction(commit: true)
704
- transaction? or raise Error, "No transaction in progress"
705
- if savepoint = @savepoints.pop
706
- if !commit
707
- pg_exec("rollback to savepoint #{savepoint}")
708
- pg_exec("release savepoint #{savepoint}")
703
+ def pop_transaction(commit: true, fail: true)
704
+ if transaction?
705
+ if savepoint = @savepoints.pop
706
+ if !commit
707
+ pg_exec("rollback to savepoint #{savepoint}")
708
+ pg_exec("release savepoint #{savepoint}")
709
+ else
710
+ pg_exec("release savepoint #{savepoint}")
711
+ end
709
712
  else
710
- pg_exec("release savepoint #{savepoint}")
713
+ @savepoints = nil
714
+ pg_exec(commit ? "commit" : "rollback")
711
715
  end
712
716
  else
713
- @savepoints = nil
714
- pg_exec(commit ? "commit" : "rollback")
717
+ fail and raise Error, "No transaction in progress"
715
718
  end
716
719
  end
717
720
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_conn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen