transaction_isolation_level 1.2.0 → 1.3.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
- SHA1:
3
- metadata.gz: c51e2c4cd964967053705462a744b8d77dcb8058
4
- data.tar.gz: c03c90b9c167fc596c75df50e31ef7a4362b5859
2
+ SHA256:
3
+ metadata.gz: f7c7bd4d72868cdf5dcae292e1b412df6ed37cce2b5bfce08bb78dfa56f65896
4
+ data.tar.gz: 0f24cbc145a84c0c965617002fcd6441e6cf5cff0ad6d8fafec7d2bba4b75044
5
5
  SHA512:
6
- metadata.gz: a03d54c3ec7bf025923b33022a260139025d0302fd89f7131303f23cd6c38e29b6f4daa4669f416643767c003906ba45ed12846ba30f899df460f845f508b410
7
- data.tar.gz: 4892314111be7920d5111c8b9d80a96af5685fbc8cfb66ab8bdbc70b2b7d0eda2901b66930cdb3efd4733f08fe60d1c12a472ecdeb47755f959cd100446aefe4
6
+ metadata.gz: aa97461acb3cd742d392cf029b02d5c08deeb79c8f52610b68070a9c4df5c3de56d48936224168e50685d56be29dae5eac25fe7aaca0a1996243a895c3ce792c
7
+ data.tar.gz: 3af16a368cd138eedbef8157b619e1b72220c82442a0b6c18782f83f823bf6f36c5701af3b43ca4efdee34d3fd0bf01fadb31d3c1efd3be5727daa0afecbe190
@@ -0,0 +1,14 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ dist: bionic
6
+ rvm:
7
+ - 2.6
8
+ services:
9
+ - postgresql
10
+ - mysql
11
+ before_script:
12
+ - createdb -U postgres transaction_isolation_level_test
13
+ - mysqladmin -u root create transaction_isolation_level_test
14
+ script: ./test_all.sh
data/Gemfile CHANGED
@@ -11,3 +11,4 @@ gemspec
11
11
  # your gem to rubygems.org.
12
12
 
13
13
  gem 'activerecord', ENV['RAILS_VERSION']
14
+ gem 'byebug'
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Will Bryant, Sekuda Ltd
1
+ Copyright (c) 2012-2018 Will Bryant, Sekuda Ltd
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -13,15 +13,22 @@ module ActiveRecord
13
13
  # uses the ConnectionHandler#establish_connection method we override here to load our patches once
14
14
  # ActiveRecord::Base#establish_connection has loaded the class to patch.
15
15
  def establish_connection_with_isolation_level_adapter_patches(*args)
16
- # need to explicitly trigger load of the adapter for 5.1 and above, as from that point on its
17
- # required only in establish_connection, and we don't have a way to insert our patches halfway
18
- # through that method.
19
- if (ActiveRecord::VERSION::MAJOR == 5 && ActiveRecord::VERSION::MINOR > 0) || ActiveRecord::VERSION::MAJOR > 5
20
- ConnectionSpecification::Resolver.new(Base.configurations).spec(args.last)
21
- end
16
+ if ActiveRecord::VERSION::MAJOR == 6 && ActiveRecord::VERSION::MINOR > 0
17
+ # establish_connection sets up a pool without actually literally establishing a connection any more,
18
+ # so we can patch the adapter after this require now
19
+ establish_connection_without_isolation_level_adapter_patches(*args)
20
+ require 'transaction_isolation_level/adapter_patches'
21
+ else
22
+ if (ActiveRecord::VERSION::MAJOR == 5 && ActiveRecord::VERSION::MINOR > 0) || ActiveRecord::VERSION::MAJOR > 5
23
+ # need to explicitly trigger load of the adapter for 5.1 and above, as from that point on its
24
+ # required only in establish_connection, and we don't have a way to insert our patches halfway
25
+ # through that method.
26
+ ConnectionSpecification::Resolver.new(Base.configurations).spec(args.last)
27
+ end
22
28
 
23
- require 'transaction_isolation_level/adapter_patches'
24
- establish_connection_without_isolation_level_adapter_patches(*args)
29
+ require 'transaction_isolation_level/adapter_patches'
30
+ establish_connection_without_isolation_level_adapter_patches(*args)
31
+ end
25
32
  end
26
33
 
27
34
  alias_method :establish_connection_without_isolation_level_adapter_patches, :establish_connection
@@ -24,7 +24,7 @@ module ActiveRecord
24
24
  end
25
25
  end
26
26
 
27
- def transaction_with_isolation_level(options = {})
27
+ def transaction_with_isolation_level(**options)
28
28
  isolation_level = options.delete(:isolation_level)
29
29
  minimum_isolation_level = options.delete(:minimum_isolation_level)
30
30
 
@@ -40,7 +40,7 @@ module ActiveRecord
40
40
  raise IncompatibleTransactionIsolationLevel, "Asked to use transaction isolation level at least #{minimum_isolation_level}, but the transaction has already begun with isolation level #{@transaction_isolation_level || default_transaction_isolation_level}"
41
41
  end
42
42
 
43
- transaction_without_isolation_level(options) { yield }
43
+ transaction_without_isolation_level(**options) { yield }
44
44
  end
45
45
 
46
46
  alias :transaction_without_isolation_level :transaction
@@ -1,3 +1,3 @@
1
1
  module TransactionIsolationLevel
2
- VERSION = '1.2.0'
2
+ VERSION = '1.3.0'
3
3
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  set -e
4
4
 
5
- for version in 4.2.10 5.0.6 5.1.4 5.2.0.beta2
5
+ for version in 5.0.7.2 5.1.7 5.2.4.4 6.0.3.4 6.1.0.rc1
6
6
  do
7
7
  RAILS_VERSION=$version bundle update activerecord
8
8
  RAILS_ENV=postgresql bundle exec rake
@@ -6,7 +6,6 @@ spec = Gem::Specification.new do |gem|
6
6
  gem.version = TransactionIsolationLevel::VERSION
7
7
  gem.summary = "Adds :isolation_level option to ActiveRecord #transaction calls"
8
8
  gem.description = "Adds :isolation_level option to ActiveRecord #transaction calls, as well as :minimum_isolation_level. Supports mysql and postgresql."
9
- gem.has_rdoc = false
10
9
  gem.author = "Will Bryant"
11
10
  gem.email = "will.bryant@gmail.com"
12
11
  gem.homepage = "http://github.com/willbryant/transaction_isolation_level"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transaction_isolation_level
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Bryant
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-03 00:00:00.000000000 Z
11
+ date: 2020-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
+ - ".travis.yml"
63
64
  - Gemfile
64
65
  - MIT-LICENSE
65
66
  - Rakefile
@@ -74,7 +75,7 @@ files:
74
75
  homepage: http://github.com/willbryant/transaction_isolation_level
75
76
  licenses: []
76
77
  metadata: {}
77
- post_install_message:
78
+ post_install_message:
78
79
  rdoc_options: []
79
80
  require_paths:
80
81
  - lib
@@ -89,9 +90,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
90
  - !ruby/object:Gem::Version
90
91
  version: '0'
91
92
  requirements: []
92
- rubyforge_project:
93
- rubygems_version: 2.5.2.2
94
- signing_key:
93
+ rubygems_version: 3.0.3
94
+ signing_key:
95
95
  specification_version: 4
96
96
  summary: 'Adds :isolation_level option to ActiveRecord #transaction calls'
97
97
  test_files: