after_transaction_commit 2.2.1 → 2.2.2

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: cf36cf518e4b8a61e6839c82b6de9c0fb395f8cddc5eebd58ba3eaa83cf1ad6a
4
- data.tar.gz: 2b3bbae3e8c7008f32ae3cead88823905b3b5206c0069757bd955143998f4d17
3
+ metadata.gz: '04185ece40a9ad439cf8a540b8728f7e9819b4512b1260f2e6b9dd7947570986'
4
+ data.tar.gz: b0394200049e17c6818818ae0b2cd8c53e842c2298b825b8b6a23a4e7489a666
5
5
  SHA512:
6
- metadata.gz: 215d7a1649b5d659485af85c1f01d5147b15d8671bad891e0e592cb22fcbdacc78ac5e6a00d5db62f7c607bbf44ad9936eeca984903ccdc285860bd5c4027aea
7
- data.tar.gz: 3368a5b925d32668e0dbd3ad096fa6fe118af53336032dbdc567e93cacfe0126e49523da14421ea3774974110916bc6b2b1365961a97b5233c4c4dcce78628c3
6
+ metadata.gz: d36862aa6c26a4d2d5e01eeaa763915ad852e1d5d5514e0a2d11d44ef5607ec7164f974192d68d7cb2ddc4c58f942e68011ed4fc12f1e5484c884845e4207f59
7
+ data.tar.gz: 8ad0470cca519558e6c825e586898f596908647f9168daf2b499140e1f75c3dbbe592f0a9a8f1ee354a7b11f4a419feca3dfa96aab4ba1f2e97ff314ba313e21
data/.travis.yml CHANGED
@@ -4,8 +4,9 @@ language: ruby
4
4
  gemfile:
5
5
  - spec/gemfiles/52.gemfile
6
6
  - spec/gemfiles/60.gemfile
7
+ - spec/gemfiles/61.gemfile
7
8
  rvm:
8
- - 2.6.2
9
+ - 2.6.5
9
10
  - 2.7.1
10
11
 
11
12
  script: bundle exec rake spec
data/README.md CHANGED
@@ -35,13 +35,13 @@ Or install it yourself as:
35
35
 
36
36
  ```ruby
37
37
  ActiveRecord::Base.transaction do
38
- ActiveRecord::Base.after_transaction_commit { run_some_background_job }
38
+ ActiveRecord::Base.connection.after_transaction_commit { run_some_background_job }
39
39
  # run_some_background_job has not run yet
40
40
  end
41
41
  # now, it has run
42
42
 
43
43
  # this one runs immediately, since we are outside a transaction
44
- ActiveRecord::Base.after_transaction_commit { some_other_task }
44
+ ActiveRecord::Base.connection.after_transaction_commit { some_other_task }
45
45
  ```
46
46
 
47
47
  ### Usage in Tests
@@ -1,8 +1,15 @@
1
1
  module AfterTransactionCommit
2
2
  module Transaction
3
- def initialize(connection, options, run_commit_callbacks: false)
4
- super
5
- @after_commit_blocks = []
3
+ if ::ActiveRecord.version >= Gem::Version.new("6.1")
4
+ def initialize(connection, **options)
5
+ super
6
+ @after_commit_blocks = []
7
+ end
8
+ else
9
+ def initialize(connection, options, run_commit_callbacks: false)
10
+ super
11
+ @after_commit_blocks = []
12
+ end
6
13
  end
7
14
 
8
15
  def add_after_commit(block)
@@ -1,3 +1,3 @@
1
1
  module AfterTransactionCommit
2
- VERSION = "2.2.1"
2
+ VERSION = "2.2.2"
3
3
  end
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec :path=>"../../"
4
+
5
+ gem "activerecord", "~> 6.1.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: after_transaction_commit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Palmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-27 00:00:00.000000000 Z
11
+ date: 2021-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -152,6 +152,7 @@ files:
152
152
  - spec/database.rb
153
153
  - spec/gemfiles/52.gemfile
154
154
  - spec/gemfiles/60.gemfile
155
+ - spec/gemfiles/61.gemfile
155
156
  - spec/spec_helper.rb
156
157
  homepage: https://github.com/instructure/after_transaction_commit
157
158
  licenses:
@@ -181,4 +182,5 @@ test_files:
181
182
  - spec/database.rb
182
183
  - spec/gemfiles/52.gemfile
183
184
  - spec/gemfiles/60.gemfile
185
+ - spec/gemfiles/61.gemfile
184
186
  - spec/spec_helper.rb