trx_ext 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a28c9749e98f72553e2ca37963009fcc8ddf841f6930cc7ad6d71ba403650b2c
4
- data.tar.gz: c45c63fdd16cb43c12d6fa6927e2d66436cb94f7b657062e0c97e92d4671c09e
3
+ metadata.gz: 489053db9c987c891db8ef10bc7ce8d513c49193c99b543a5d9610dc80cfe18b
4
+ data.tar.gz: a964c8bbf189217897b61237ac6be0fb8c35ba669efae9b65a24f7a5323a7789
5
5
  SHA512:
6
- metadata.gz: 94b03b1b7a7a003a068da0799ab8de8bf594d4503f9eb763a0f68cfec3c98f8c2a90c43cf836ee42b4b31c90b872f218781ca60068dedfd10b1eb4a520d90c50
7
- data.tar.gz: b825acd8dc75edbfb351d02a5ce622a6d75bad5b2dc1a14a011c255b31cac6afb007ee46769272d24113dacf78cafe1882af6ce0aad94e0d6fad755d1eb434d6
6
+ metadata.gz: b09b5eb4644c73a3717d27808b6d9fc7c570b9447a0cfb038952ed862ee240ff880d3650e9688482ea9084c28d429b86663a3e39f55950a179c9b870b33cec00
7
+ data.tar.gz: 74bcdd9e164756cfcdf97132a32d3c08d0cc19785261e4ae827a7f73732db504171494eb52bdea994848aaffa6b25675ba7a7395f76297ae9718e06f0b27cb24
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0.2
1
+ 3.2.2
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Nothing new yet
4
4
 
5
+ ## [1.0.5] - 2022-01-27
6
+
7
+ - Load `Object` extension earlier
8
+
5
9
  ## [1.0.2] - 2022-01-27
6
10
 
7
11
  - Add support of ActiveRecord `7.0.1`
data/lib/trx_ext/retry.rb CHANGED
@@ -28,10 +28,10 @@ module TrxExt
28
28
  yield
29
29
  rescue => error
30
30
  error_classification = error_classification(error)
31
- if error_classification == :record_not_unique
32
- retries_count += 1
33
- end
34
31
  if retry_query?(error, retries_count)
32
+ if error_classification == :record_not_unique
33
+ retries_count += 1
34
+ end
35
35
  TrxExt.log("Detected transaction rollback condition. Reason - #{error_classification}. Retrying...")
36
36
  retry
37
37
  else
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TrxExt
4
- VERSION = "1.0.3"
5
- SUPPORTED_AR_VERSIONS = %w(6.0.4.7 6.1.5 7.0.2.3).freeze
4
+ VERSION = "1.0.5"
5
+ SUPPORTED_AR_VERSIONS = ['~> 6.0', '~> 6.1', '~> 7.0'].freeze
6
6
  end
data/lib/trx_ext.rb CHANGED
@@ -14,12 +14,12 @@ module TrxExt
14
14
 
15
15
  # @return [void]
16
16
  def integrate!
17
+ # Allow to use #wrap_in_trx and #trx methods everywhere
18
+ Object.prepend(TrxExt::ObjectExt)
19
+
17
20
  ActiveSupport.on_load(:active_record) do
18
21
  require 'active_record/connection_adapters/postgresql_adapter'
19
22
 
20
- # Allow to use #wrap_in_trx and #trx methods everywhere
21
- Object.prepend(TrxExt::ObjectExt)
22
-
23
23
  # Patch #transaction
24
24
  ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(TrxExt::Transaction)
25
25
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trx_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Dzyzenko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-01 00:00:00.000000000 Z
11
+ date: 2023-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -143,8 +143,8 @@ licenses:
143
143
  metadata:
144
144
  allowed_push_host: https://rubygems.org
145
145
  homepage_uri: https://github.com/intale/trx_ext
146
- source_code_uri: https://github.com/intale/trx_ext/tree/v1.0.3
147
- changelog_uri: https://github.com/intale/trx_ext/blob/v1.0.3/CHANGELOG.md
146
+ source_code_uri: https://github.com/intale/trx_ext/tree/v1.0.5
147
+ changelog_uri: https://github.com/intale/trx_ext/blob/v1.0.5/CHANGELOG.md
148
148
  post_install_message:
149
149
  rdoc_options: []
150
150
  require_paths:
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  - !ruby/object:Gem::Version
161
161
  version: '0'
162
162
  requirements: []
163
- rubygems_version: 3.2.28
163
+ rubygems_version: 3.4.10
164
164
  signing_key:
165
165
  specification_version: 4
166
166
  summary: ActiveRecord's transaction extension