trx_ext 3.0.1 → 3.0.2

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: 612cb753cf993df910e1aa8f78f2805d6c6b4343a177d7207b4424f10a592f57
4
- data.tar.gz: b88c88407a73520e4946a3c9fb4650f5901635a6f422a0011399fec7404adbfe
3
+ metadata.gz: 52f0fff7319c96a73f1b8ebdd31319b39226eb0c6af85d079922df3e5050a217
4
+ data.tar.gz: 668acf38fe3f96493cb0a7904327f493404082bb113ceae0d750cd437eaebd76
5
5
  SHA512:
6
- metadata.gz: 43fc20f724d7396c8672bf601f1b4ccef9e510a60d6394f8eaf4dda4392fe3fac9db36dcc413b442abba5e49e90c235f94d706c67f4a64b63d11f0ec675fe1dd
7
- data.tar.gz: 1fc7f30a3d395b09027b75e220bf4e1bed61b11be041d52ce62fcec8ba6742c99ba62941d3ebccb58e1f7f3f8f4de601ab66580f59eb18ba7809c572b7db1ee8
6
+ metadata.gz: 135d27423fdf5631fbfdb3606f875241d93f963a15b96aa3c34aab1de005558a841d5e73caec64dca6fe424b53304255216fb0f6d66fbba5a03fa636c910bf89
7
+ data.tar.gz: 6c6887c5138835e6fa560310cf6ab259a89392458ca0318f95a7c26b5581f8982681c4056e53a8766add9ac93f4d9bc326c174e0fd3f03c839b81eada24b51c6
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.5
1
+ 3.4.7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [3.0.2] - 2025-10-30
4
+ - Allow rails v8.1
5
+
3
6
  ## [3.0.1] - 2024-12-08
4
7
  - Allow rails v8.0
5
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # frozen_string_literal: true
4
4
 
5
- %w[7.2 8.0].each do |ar_version|
5
+ %w[7.2 8.0 8.1].each do |ar_version|
6
6
  `rm Gemfile.lock`
7
7
  Process.waitpid(Kernel.spawn({ 'AR_VERSION' => ar_version }, "bundle install --quiet", close_others: true))
8
8
  Process.waitpid(Kernel.spawn({ 'AR_VERSION' => ar_version }, "rspec", close_others: true))
data/docker-compose.yml CHANGED
@@ -2,14 +2,14 @@ version: "3.5"
2
2
 
3
3
  services:
4
4
  postgres:
5
- image: postgres:16
5
+ image: postgres:18
6
6
  command: ["postgres", "-c", "log_statement=all", "-c", "default_transaction_isolation=serializable"]
7
7
  ports:
8
8
  - 5532:5432
9
9
  environment:
10
10
  - POSTGRES_PASSWORD=postgres
11
11
  mysql:
12
- image: mysql:8.3
12
+ image: mysql:9.4
13
13
  command:
14
14
  - /usr/local/bin/mysqld.sh
15
15
  volumes:
data/dummy_app/.gitignore CHANGED
@@ -32,7 +32,3 @@
32
32
  # Ignore master key for decrypting credentials and more.
33
33
  /config/master.key
34
34
  Gemfile.lock
35
- db/schema.rb
36
- db/primary_sqlite_schema.rb
37
- db/primary_mysql_schema.rb
38
- db/primary_trilogy_schema.rb
@@ -0,0 +1,20 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema[7.2].define(version: 2024_01_28_111549) do
14
+ create_table "dummy_mysql_records", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
15
+ t.datetime "created_at", null: false
16
+ t.string "name"
17
+ t.string "unique_name"
18
+ t.index ["unique_name"], name: "index_dummy_mysql_records_on_unique_name", unique: true
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema[7.2].define(version: 2024_01_28_111549) do
14
+ create_table "dummy_sqlite_records", force: :cascade do |t|
15
+ t.datetime "created_at", null: false
16
+ t.string "name"
17
+ t.string "unique_name"
18
+ t.index ["unique_name"], name: "index_dummy_sqlite_records_on_unique_name", unique: true
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema[7.2].define(version: 2024_01_28_111549) do
14
+ create_table "dummy_trilogy_records", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
15
+ t.datetime "created_at", null: false
16
+ t.string "name"
17
+ t.string "unique_name"
18
+ t.index ["unique_name"], name: "index_dummy_trilogy_records_on_unique_name", unique: true
19
+ end
20
+ end
@@ -0,0 +1,23 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema[7.2].define(version: 2024_01_28_111549) do
14
+ # These are extensions that must be enabled in order to support this database
15
+ enable_extension "pg_catalog.plpgsql"
16
+
17
+ create_table "dummy_pg_records", force: :cascade do |t|
18
+ t.datetime "created_at", null: false
19
+ t.string "name"
20
+ t.string "unique_name"
21
+ t.index ["unique_name"], name: "index_dummy_pg_records_on_unique_name", unique: true
22
+ end
23
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TrxExt
4
- VERSION = "3.0.1"
4
+ VERSION = "3.0.2"
5
5
  end
data/lib/trx_ext.rb CHANGED
@@ -1,12 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'active_record'
4
- require_relative "trx_ext/object_ext"
5
- require_relative "trx_ext/retry"
6
- require_relative "trx_ext/config"
7
- require_relative "trx_ext/version"
4
+ require_relative 'trx_ext/object_ext'
5
+ require_relative 'trx_ext/retry'
6
+ require_relative 'trx_ext/config'
7
+ require_relative 'trx_ext/version'
8
8
 
9
9
  module TrxExt
10
+ SUPPORTED_ADAPTERS = %i[
11
+ active_record_mysql2adapter
12
+ active_record_postgresqladapter
13
+ active_record_sqlite3adapter
14
+ active_record_trilogyadapter
15
+ ].freeze
16
+
10
17
  class << self
11
18
  attr_accessor :logger
12
19
 
@@ -14,10 +21,9 @@ module TrxExt
14
21
  def integrate!
15
22
  # Allow to use #wrap_in_trx and #trx methods everywhere
16
23
  Object.prepend(TrxExt::ObjectExt)
17
- ActiveSupport.on_load(:active_record_mysql2adapter, &method(:integrate_into_class))
18
- ActiveSupport.on_load(:active_record_postgresqladapter, &method(:integrate_into_class))
19
- ActiveSupport.on_load(:active_record_sqlite3adapter, &method(:integrate_into_class))
20
- ActiveSupport.on_load(:active_record_trilogyadapter, &method(:integrate_into_class))
24
+ SUPPORTED_ADAPTERS.each do |adapter_name|
25
+ ActiveSupport.on_load(adapter_name, &method(:integrate_into_class))
26
+ end
21
27
  end
22
28
 
23
29
  # @return [void]
@@ -37,12 +43,9 @@ module TrxExt
37
43
  private
38
44
 
39
45
  def integrate_into_class(klass)
40
- TrxExt::Retry.with_retry_until_serialized(klass, :exec_query)
41
- TrxExt::Retry.with_retry_until_serialized(klass, :exec_insert)
42
- TrxExt::Retry.with_retry_until_serialized(klass, :exec_delete)
43
- TrxExt::Retry.with_retry_until_serialized(klass, :exec_update)
44
- TrxExt::Retry.with_retry_until_serialized(klass, :exec_insert_all)
45
- TrxExt::Retry.with_retry_until_serialized(klass, :transaction)
46
+ %i[exec_query exec_insert exec_delete exec_update exec_insert_all transaction].each do |method_name|
47
+ TrxExt::Retry.with_retry_until_serialized(klass, method_name)
48
+ end
46
49
  end
47
50
  end
48
51
  end
data/trx_ext.gemspec CHANGED
@@ -31,5 +31,5 @@ Gem::Specification.new do |spec|
31
31
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
32
  spec.require_paths = ["lib"]
33
33
 
34
- spec.add_dependency 'activerecord', '>= 7.2', '< 8.1'
34
+ spec.add_dependency 'activerecord', '>= 7.2', '< 8.2'
35
35
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trx_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Dzyzenko
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-12-08 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activerecord
@@ -19,7 +18,7 @@ dependencies:
19
18
  version: '7.2'
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
- version: '8.1'
21
+ version: '8.2'
23
22
  type: :runtime
24
23
  prerelease: false
25
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +28,7 @@ dependencies:
29
28
  version: '7.2'
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
- version: '8.1'
31
+ version: '8.2'
33
32
  description: Allow you to retry deadlocks, serialization errors, non-unique errors.
34
33
  email:
35
34
  - ivan.dzyzenko@gmail.com
@@ -85,8 +84,12 @@ files:
85
84
  - dummy_app/db/migrate/.keep
86
85
  - dummy_app/db/migrate/20240128111549_create_dummy_record.rb
87
86
  - dummy_app/db/primary_mysql/20240128111549_create_dummy_mysql_record.rb
87
+ - dummy_app/db/primary_mysql_schema.rb
88
88
  - dummy_app/db/primary_sqlite/20240128111549_create_dummy_sqlite_record.rb
89
+ - dummy_app/db/primary_sqlite_schema.rb
89
90
  - dummy_app/db/primary_trilogy/20240128111549_create_dummy_trilogy_record.rb
91
+ - dummy_app/db/primary_trilogy_schema.rb
92
+ - dummy_app/db/schema.rb
90
93
  - dummy_app/db/seeds.rb
91
94
  - dummy_app/lib/tasks/.keep
92
95
  - dummy_app/log/.keep
@@ -107,9 +110,8 @@ licenses:
107
110
  metadata:
108
111
  allowed_push_host: https://rubygems.org
109
112
  homepage_uri: https://github.com/intale/trx_ext
110
- source_code_uri: https://github.com/intale/trx_ext/tree/v3.0.1
111
- changelog_uri: https://github.com/intale/trx_ext/blob/v3.0.1/CHANGELOG.md
112
- post_install_message:
113
+ source_code_uri: https://github.com/intale/trx_ext/tree/v3.0.2
114
+ changelog_uri: https://github.com/intale/trx_ext/blob/v3.0.2/CHANGELOG.md
113
115
  rdoc_options: []
114
116
  require_paths:
115
117
  - lib
@@ -124,8 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
126
  - !ruby/object:Gem::Version
125
127
  version: '0'
126
128
  requirements: []
127
- rubygems_version: 3.5.16
128
- signing_key:
129
+ rubygems_version: 3.6.9
129
130
  specification_version: 4
130
131
  summary: ActiveRecord's transaction extension
131
132
  test_files: []