umbrellio-utils 1.5.2 → 1.5.4

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: 8df77131c011a6b48b5cd6e81bd86a5a806034dbf8dfde59cac4bcb52a7c15e7
4
- data.tar.gz: 7f97769c05db4332bebca56efbb0ae5b34ec34a6661ba0920b6643a706dfa44b
3
+ metadata.gz: a4e43e1767e326b2618405c88cf6d82ea59e54cc64050db2bd946908dd03375c
4
+ data.tar.gz: fd1911647c5ec70de5ab80a90e3ffca57df6f870f505465cc50895df995de248
5
5
  SHA512:
6
- metadata.gz: c41253ac5670ae0196c0c0e28dd846be23a955e71cef9c8ee9f9e757b673b114bcb2c4f1090b869be85d6e801c99d6576afeb81c04982c37735c1b4f5e187c6a
7
- data.tar.gz: 5e73d3802b9ca525914b8db176974c2ac81c09a778493b57d0cf7e3716fa42c981cd16ad2bf4e5ceca6d7834a9414a9bd6d38999f6caea05451aff41b4d51f0d
6
+ metadata.gz: c7549e20b5d963452958f57cbd2f81802d4033a8dc2648cfa843304b8f66cf39ffd8c8237ed80a28bec3faa37ba0c3120618d45f06b267166939dbf967998dd3
7
+ data.tar.gz: ef23c887cb3976d05535be1a648d29cc21acb7949659c8b572fc21452e013a9c99e2db9b1ef904c67e63ee3125aaadefce3365780cd94bf972b6169518c1a722
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- umbrellio-utils (1.5.2)
4
+ umbrellio-utils (1.5.4)
5
5
  memery (~> 1)
6
6
 
7
7
  GEM
@@ -19,8 +19,19 @@ module UmbrellioUtils
19
19
  end
20
20
 
21
21
  def retry_on_unique_violation(
22
- times: Float::INFINITY, retry_on_all_constraints: false, checked_constraints: [], &block
22
+ times: Float::INFINITY,
23
+ retry_on_all_constraints: false,
24
+ checked_constraints: [],
25
+ &block
23
26
  )
27
+ if !retry_on_all_constraints && checked_constraints.empty?
28
+ begin
29
+ return yield
30
+ rescue Sequel::UniqueConstraintViolation => e
31
+ raise UniqueConstraintViolation, e.message
32
+ end
33
+ end
34
+
24
35
  retry_on(Sequel::UniqueConstraintViolation, times:) do
25
36
  DB.transaction(savepoint: true, &block)
26
37
  rescue Sequel::UniqueConstraintViolation => e
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UmbrellioUtils
4
- VERSION = "1.5.2"
4
+ VERSION = "1.5.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: umbrellio-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Team Umbrellio