isolator 1.1.1 → 1.1.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: 84829cfcac568cd691333a7d2e36d7413414c0aaf3c1980a5445725ee35b3506
4
- data.tar.gz: 4cda5f918834344df2fa05ecec3e60869cc191d8802b5563f8e653d954ea01d7
3
+ metadata.gz: a37693d4626a6bb72e14c00562274a1002c557aca0122182f2422be08e225ad8
4
+ data.tar.gz: ed49eb36314577217281389ea07d3dcb8c72c30373fd03f6b6609e2d43ea4d99
5
5
  SHA512:
6
- metadata.gz: f152a5a36394be2a010535ac14511b66cafeaeaa65e079e05f8ab2b4849992a5dbbe07ef212a1b150fd6a5cd9297527dbbed671937839413ed8e6e26b946db7b
7
- data.tar.gz: ef341ee673b9463893ac903a89b4ffb68967dc9fd8422f04d2717904a2e4338bc1a819157f3435749b5c1f65892b963454c05fd0a54908704e447bfc025701b5
6
+ metadata.gz: e3c11b5f2da9fa95dc4f167b757e5a0dee3466ead28cb458839b1651b8e6db0631f72b9d1bcc0de239f41adb27b3dbd99aab46cf2d3872bcd462c75aa61aa471
7
+ data.tar.gz: c9ea41ae4b214da35c3e5c8c53c75c5f8f3b74b620ff5e2f3d1dbfcbb52312f3620ba811829c7a46b82de87cb00420d74b55d1efc7b5a1cd47295ac4eca60afe
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.1.2 (2025-10-16)
6
+
7
+ - Fix `database_cleaner` support: require `base.rb` explicitly. ([@viralpraxis][])
8
+
9
+ - Fix checking for Rails versions between 8.0 and 8.1. ([@sunny][])
10
+
5
11
  ## 1.1.1 (2025-03-12)
6
12
 
7
13
  - Fix handling Rails 8 `enqueue_after_transaction_commit` logic. ([@palkan][])
data/README.md CHANGED
@@ -108,7 +108,7 @@ Isolator.configure do |config|
108
108
  config.ignorer = Isolator::Ignorer
109
109
 
110
110
  # Turn on/off raising exceptions for simultaneous transactions to different databases
111
- config.disallow_cross_database_transactions = false
111
+ config.disallow_per_thread_concurrent_transactions = false
112
112
  end
113
113
  ```
114
114
 
@@ -132,13 +132,13 @@ Isolator.after_isolate do
132
132
  end
133
133
 
134
134
  # This callback is called every time a new transaction is open (root or nested)
135
- Isolator.on_transaction_open do |event|
135
+ Isolator.on_transaction_begin do |event|
136
136
  puts "New transaction from #{event[:connection_id]}. " \
137
137
  "Current depth: #{event[:depth]}"
138
138
  end
139
139
 
140
140
  # This callback is called every time a transaction is completed
141
- Isolator.on_transaction_close do |event|
141
+ Isolator.on_transaction_end do |event|
142
142
  puts "Transaction completed from #{event[:connection_id]}. " \
143
143
  "Current depth: #{event[:depth]}"
144
144
  end
@@ -6,7 +6,7 @@ Isolator.isolate :active_job,
6
6
  exception_class: Isolator::BackgroundJobError,
7
7
  details_message: ->(obj) {
8
8
  "#{obj.class.name}" \
9
- "#{obj.arguments.any? ? " (#{obj.arguments.join(", ")})" : ""}"
9
+ "#{" (#{obj.arguments.join(", ")})" if obj.arguments.any?}"
10
10
  },
11
11
  ignore_on: ->(job) {
12
12
  config = job.class.try(:enqueue_after_transaction_commit)
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "database_cleaner/active_record/base"
3
4
  require "database_cleaner/active_record/transaction"
4
5
  ::DatabaseCleaner::ActiveRecord::Transaction.prepend(
5
6
  Module.new do
@@ -3,7 +3,8 @@
3
3
  require_relative "active_support_subscriber"
4
4
 
5
5
  # We rely on this feature introduced in 7.1.0.beta1: https://github.com/rails/rails/pull/49192
6
- if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
6
+ if (ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1) ||
7
+ ActiveRecord.version >= Gem::Version.new("7.1")
7
8
  require_relative "active_support_transaction_subscriber"
8
9
  Isolator::ActiveSupportTransactionSubscriber.subscribe!
9
10
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Isolator
4
- VERSION = "1.1.1"
4
+ VERSION = "1.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isolator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-12 00:00:00.000000000 Z
11
+ date: 2025-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sniffer