after_transaction_commit 1.0.1 → 1.1.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
2
  SHA1:
3
- metadata.gz: 6ed45a41c55308e3c2d73c305c8b06137a340f4d
4
- data.tar.gz: 611cfbf86c075c63f0464ac4e3af27c18ba8c7eb
3
+ metadata.gz: a4165447ab4b683699ba7c83f00f146dfc2b16d7
4
+ data.tar.gz: 551149649de9ba7f7048e1f86b111f3698d0d756
5
5
  SHA512:
6
- metadata.gz: c8e86cc726df3be223ab37b131f2f033fedf685927cf90a3c29f722c167422b6fd96d71d3bc977747f1068b22af80e24fe0f4bab0bf0d87b3e6422fd122d32b4
7
- data.tar.gz: b9fdffde526a87be30fe4e04ff6e73c1e03096ffea306ca62512b1cbf545755992258bc61dff4ce89f708d42ff996fb75b106c590304185e34ad3604c4ee7d2d
6
+ metadata.gz: e46f1ff9660d8e0467251a1f3571de9895fa184bd132249f102e57bb36c33256b0b5aa31ffd0c5e1ccd36a2b96cba04f3234ed090a10731f87e78cf1ffb34ce3
7
+ data.tar.gz: 68d74ffaca0ad4cbdf7911266c7e8dbd85d02eabe271b8f4951580e0d035a1a7af6116a77c40be4fa6f833152888030c1278da3b961e7672521a5043a06a477d
@@ -1,17 +1,22 @@
1
1
  bundler_args: ""
2
2
  language: ruby
3
+
3
4
  gemfile:
4
- - spec/gemfiles/32.gemfile
5
5
  - spec/gemfiles/40.gemfile
6
6
  - spec/gemfiles/41.gemfile
7
7
  - spec/gemfiles/42.gemfile
8
+ - spec/gemfiles/50.gemfile
8
9
  rvm:
9
- - 1.9.3
10
- - 2.0.0
11
- - 2.1.3
10
+ - 2.1.10
11
+ - 2.2.5
12
+ - 2.3.1
12
13
  env:
13
14
  - REAL=1
14
15
  - TEST=1
16
+
15
17
  matrix:
16
18
  exclude:
19
+ - gemfile: spec/gemfiles/50.gemfile
20
+ rvm: 2.1.10
21
+
17
22
  script: bundle exec rake spec
@@ -17,11 +17,13 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency "activerecord", ">= 3.2"
20
+ spec.required_ruby_version = ">= 2.1"
21
+
22
+ spec.add_dependency "activerecord", ">= 4.0"
21
23
 
22
24
  spec.add_development_dependency "bump"
23
- spec.add_development_dependency "bundler", "~> 1.6"
24
- spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "bundler", "~> 1.11"
26
+ spec.add_development_dependency "rake", "~> 11.0"
25
27
  spec.add_development_dependency "rspec"
26
28
  spec.add_development_dependency "sqlite3"
27
29
  spec.add_development_dependency "wwtd"
@@ -1,14 +1,19 @@
1
1
  module AfterTransactionCommit
2
2
  end
3
3
 
4
+ unless ActiveRecord::VERSION::MAJOR.between? 4, 5
5
+ raise "Unsupported Rails version"
6
+ end
7
+
4
8
  require "after_transaction_commit/version"
5
9
  require "after_transaction_commit/database_statements"
10
+ require "after_transaction_commit/transaction"
6
11
 
7
- case ActiveRecord::VERSION::MAJOR
8
- when 3
9
- require "after_transaction_commit/rails3"
10
- when 4
11
- require "after_transaction_commit/rails4"
12
- else
13
- raise "Unsupported rails version"
14
- end
12
+ # force autoloading if necessary
13
+ _ = ActiveRecord::ConnectionAdapters::RealTransaction
14
+
15
+ klass = defined?(ActiveRecord::ConnectionAdapters::OpenTransaction) ?
16
+ ActiveRecord::ConnectionAdapters::OpenTransaction : # rails < 4.2
17
+ ActiveRecord::ConnectionAdapters::Transaction # rails >= 4.2
18
+
19
+ klass.prepend AfterTransactionCommit::Transaction
@@ -0,0 +1,16 @@
1
+ module AfterTransactionCommit
2
+ module Transaction
3
+ def rollback_records
4
+ super
5
+ if self.is_a?(ActiveRecord::ConnectionAdapters::RealTransaction) ||
6
+ (connection.send(:_transaction_test_mode?) && connection.send(:_test_open_transactions) == 0)
7
+ connection.send(:_remove_after_transaction_commit_callbacks)
8
+ end
9
+ end
10
+
11
+ def commit_records
12
+ super
13
+ connection.send(:_run_after_transaction_commit_callbacks)
14
+ end
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module AfterTransactionCommit
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -9,22 +9,22 @@ GIT
9
9
  PATH
10
10
  remote: ../../
11
11
  specs:
12
- after_transaction_commit (1.0.0)
13
- activerecord (>= 3.2)
12
+ after_transaction_commit (1.1.0)
13
+ activerecord (>= 4.0)
14
14
 
15
15
  GEM
16
16
  remote: https://rubygems.org/
17
17
  specs:
18
- activemodel (4.0.10)
19
- activesupport (= 4.0.10)
18
+ activemodel (4.0.13)
19
+ activesupport (= 4.0.13)
20
20
  builder (~> 3.1.0)
21
- activerecord (4.0.10)
22
- activemodel (= 4.0.10)
21
+ activerecord (4.0.13)
22
+ activemodel (= 4.0.13)
23
23
  activerecord-deprecated_finders (~> 1.0.2)
24
- activesupport (= 4.0.10)
24
+ activesupport (= 4.0.13)
25
25
  arel (~> 4.0.0)
26
- activerecord-deprecated_finders (1.0.3)
27
- activesupport (4.0.10)
26
+ activerecord-deprecated_finders (1.0.4)
27
+ activesupport (4.0.13)
28
28
  i18n (~> 0.6, >= 0.6.9)
29
29
  minitest (~> 4.2)
30
30
  multi_json (~> 1.3)
@@ -32,27 +32,29 @@ GEM
32
32
  tzinfo (~> 0.3.37)
33
33
  arel (4.0.2)
34
34
  builder (3.1.4)
35
+ bump (0.5.3)
35
36
  diff-lcs (1.2.5)
36
- i18n (0.6.11)
37
+ i18n (0.7.0)
37
38
  minitest (4.7.5)
38
- multi_json (1.10.1)
39
- rake (10.3.2)
40
- rspec (3.1.0)
41
- rspec-core (~> 3.1.0)
42
- rspec-expectations (~> 3.1.0)
43
- rspec-mocks (~> 3.1.0)
44
- rspec-core (3.1.4)
45
- rspec-support (~> 3.1.0)
46
- rspec-expectations (3.1.2)
39
+ multi_json (1.12.1)
40
+ rake (11.3.0)
41
+ rspec (3.5.0)
42
+ rspec-core (~> 3.5.0)
43
+ rspec-expectations (~> 3.5.0)
44
+ rspec-mocks (~> 3.5.0)
45
+ rspec-core (3.5.4)
46
+ rspec-support (~> 3.5.0)
47
+ rspec-expectations (3.5.0)
48
+ diff-lcs (>= 1.2.0, < 2.0)
49
+ rspec-support (~> 3.5.0)
50
+ rspec-mocks (3.5.0)
47
51
  diff-lcs (>= 1.2.0, < 2.0)
48
- rspec-support (~> 3.1.0)
49
- rspec-mocks (3.1.2)
50
- rspec-support (~> 3.1.0)
51
- rspec-support (3.1.1)
52
- sqlite3 (1.3.9)
53
- thread_safe (0.3.4)
54
- tzinfo (0.3.41)
55
- wwtd (0.5.5)
52
+ rspec-support (~> 3.5.0)
53
+ rspec-support (3.5.0)
54
+ sqlite3 (1.3.11)
55
+ thread_safe (0.3.5)
56
+ tzinfo (0.3.51)
57
+ wwtd (1.3.0)
56
58
 
57
59
  PLATFORMS
58
60
  ruby
@@ -60,9 +62,13 @@ PLATFORMS
60
62
  DEPENDENCIES
61
63
  activerecord (~> 4.0.0)
62
64
  after_transaction_commit!
63
- bundler (~> 1.6)
64
- rake (~> 10.0)
65
+ bump
66
+ bundler (~> 1.11)
67
+ rake (~> 11.0)
65
68
  rspec
66
69
  sqlite3
67
70
  test_after_commit!
68
71
  wwtd
72
+
73
+ BUNDLED WITH
74
+ 1.12.5
@@ -9,20 +9,20 @@ GIT
9
9
  PATH
10
10
  remote: ../../
11
11
  specs:
12
- after_transaction_commit (1.0.0)
13
- activerecord (>= 3.2)
12
+ after_transaction_commit (1.1.0)
13
+ activerecord (>= 4.0)
14
14
 
15
15
  GEM
16
16
  remote: https://rubygems.org/
17
17
  specs:
18
- activemodel (4.1.6)
19
- activesupport (= 4.1.6)
18
+ activemodel (4.1.16)
19
+ activesupport (= 4.1.16)
20
20
  builder (~> 3.1)
21
- activerecord (4.1.6)
22
- activemodel (= 4.1.6)
23
- activesupport (= 4.1.6)
21
+ activerecord (4.1.16)
22
+ activemodel (= 4.1.16)
23
+ activesupport (= 4.1.16)
24
24
  arel (~> 5.0.0)
25
- activesupport (4.1.6)
25
+ activesupport (4.1.16)
26
26
  i18n (~> 0.6, >= 0.6.9)
27
27
  json (~> 1.7, >= 1.7.7)
28
28
  minitest (~> 5.1)
@@ -30,28 +30,30 @@ GEM
30
30
  tzinfo (~> 1.1)
31
31
  arel (5.0.1.20140414130214)
32
32
  builder (3.2.2)
33
+ bump (0.5.3)
33
34
  diff-lcs (1.2.5)
34
- i18n (0.6.11)
35
- json (1.8.1)
36
- minitest (5.4.1)
37
- rake (10.3.2)
38
- rspec (3.1.0)
39
- rspec-core (~> 3.1.0)
40
- rspec-expectations (~> 3.1.0)
41
- rspec-mocks (~> 3.1.0)
42
- rspec-core (3.1.4)
43
- rspec-support (~> 3.1.0)
44
- rspec-expectations (3.1.2)
35
+ i18n (0.7.0)
36
+ json (1.8.3)
37
+ minitest (5.9.1)
38
+ rake (11.3.0)
39
+ rspec (3.5.0)
40
+ rspec-core (~> 3.5.0)
41
+ rspec-expectations (~> 3.5.0)
42
+ rspec-mocks (~> 3.5.0)
43
+ rspec-core (3.5.4)
44
+ rspec-support (~> 3.5.0)
45
+ rspec-expectations (3.5.0)
46
+ diff-lcs (>= 1.2.0, < 2.0)
47
+ rspec-support (~> 3.5.0)
48
+ rspec-mocks (3.5.0)
45
49
  diff-lcs (>= 1.2.0, < 2.0)
46
- rspec-support (~> 3.1.0)
47
- rspec-mocks (3.1.2)
48
- rspec-support (~> 3.1.0)
49
- rspec-support (3.1.1)
50
- sqlite3 (1.3.9)
51
- thread_safe (0.3.4)
50
+ rspec-support (~> 3.5.0)
51
+ rspec-support (3.5.0)
52
+ sqlite3 (1.3.11)
53
+ thread_safe (0.3.5)
52
54
  tzinfo (1.2.2)
53
55
  thread_safe (~> 0.1)
54
- wwtd (0.5.5)
56
+ wwtd (1.3.0)
55
57
 
56
58
  PLATFORMS
57
59
  ruby
@@ -59,9 +61,13 @@ PLATFORMS
59
61
  DEPENDENCIES
60
62
  activerecord (~> 4.1.0)
61
63
  after_transaction_commit!
62
- bundler (~> 1.6)
63
- rake (~> 10.0)
64
+ bump
65
+ bundler (~> 1.11)
66
+ rake (~> 11.0)
64
67
  rspec
65
68
  sqlite3
66
69
  test_after_commit!
67
70
  wwtd
71
+
72
+ BUNDLED WITH
73
+ 1.12.5
@@ -9,49 +9,51 @@ GIT
9
9
  PATH
10
10
  remote: ../../
11
11
  specs:
12
- after_transaction_commit (1.0.0)
13
- activerecord (>= 3.2)
12
+ after_transaction_commit (1.1.0)
13
+ activerecord (>= 4.0)
14
14
 
15
15
  GEM
16
16
  remote: https://rubygems.org/
17
17
  specs:
18
- activemodel (4.2.0.beta2)
19
- activesupport (= 4.2.0.beta2)
18
+ activemodel (4.2.7.1)
19
+ activesupport (= 4.2.7.1)
20
20
  builder (~> 3.1)
21
- activerecord (4.2.0.beta2)
22
- activemodel (= 4.2.0.beta2)
23
- activesupport (= 4.2.0.beta2)
24
- arel (>= 6.0.0.beta1, < 6.1)
25
- activesupport (4.2.0.beta2)
26
- i18n (>= 0.7.0.beta1, < 0.8)
21
+ activerecord (4.2.7.1)
22
+ activemodel (= 4.2.7.1)
23
+ activesupport (= 4.2.7.1)
24
+ arel (~> 6.0)
25
+ activesupport (4.2.7.1)
26
+ i18n (~> 0.7)
27
27
  json (~> 1.7, >= 1.7.7)
28
28
  minitest (~> 5.1)
29
- thread_safe (~> 0.1)
29
+ thread_safe (~> 0.3, >= 0.3.4)
30
30
  tzinfo (~> 1.1)
31
- arel (6.0.0.beta1)
31
+ arel (6.0.3)
32
32
  builder (3.2.2)
33
+ bump (0.5.3)
33
34
  diff-lcs (1.2.5)
34
- i18n (0.7.0.beta1)
35
- json (1.8.1)
36
- minitest (5.4.1)
37
- rake (10.3.2)
38
- rspec (3.1.0)
39
- rspec-core (~> 3.1.0)
40
- rspec-expectations (~> 3.1.0)
41
- rspec-mocks (~> 3.1.0)
42
- rspec-core (3.1.4)
43
- rspec-support (~> 3.1.0)
44
- rspec-expectations (3.1.2)
35
+ i18n (0.7.0)
36
+ json (1.8.3)
37
+ minitest (5.9.1)
38
+ rake (11.3.0)
39
+ rspec (3.5.0)
40
+ rspec-core (~> 3.5.0)
41
+ rspec-expectations (~> 3.5.0)
42
+ rspec-mocks (~> 3.5.0)
43
+ rspec-core (3.5.4)
44
+ rspec-support (~> 3.5.0)
45
+ rspec-expectations (3.5.0)
45
46
  diff-lcs (>= 1.2.0, < 2.0)
46
- rspec-support (~> 3.1.0)
47
- rspec-mocks (3.1.2)
48
- rspec-support (~> 3.1.0)
49
- rspec-support (3.1.1)
50
- sqlite3 (1.3.9)
51
- thread_safe (0.3.4)
47
+ rspec-support (~> 3.5.0)
48
+ rspec-mocks (3.5.0)
49
+ diff-lcs (>= 1.2.0, < 2.0)
50
+ rspec-support (~> 3.5.0)
51
+ rspec-support (3.5.0)
52
+ sqlite3 (1.3.11)
53
+ thread_safe (0.3.5)
52
54
  tzinfo (1.2.2)
53
55
  thread_safe (~> 0.1)
54
- wwtd (0.5.5)
56
+ wwtd (1.3.0)
55
57
 
56
58
  PLATFORMS
57
59
  ruby
@@ -59,9 +61,13 @@ PLATFORMS
59
61
  DEPENDENCIES
60
62
  activerecord (~> 4.2.0.beta2)
61
63
  after_transaction_commit!
62
- bundler (~> 1.6)
63
- rake (~> 10.0)
64
+ bump
65
+ bundler (~> 1.11)
66
+ rake (~> 11.0)
64
67
  rspec
65
68
  sqlite3
66
69
  test_after_commit!
67
70
  wwtd
71
+
72
+ BUNDLED WITH
73
+ 1.12.5
@@ -2,7 +2,7 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec :path=>"../../"
4
4
 
5
- gem "activerecord", "~> 3.2.19"
5
+ gem "activerecord", "~> 5.0.0"
6
6
 
7
7
  group :test do
8
8
  gem 'test_after_commit', git: 'https://github.com/codekitchen/test_after_commit.git', branch: 'nested-commit-callbacks'
@@ -0,0 +1,70 @@
1
+ GIT
2
+ remote: https://github.com/codekitchen/test_after_commit.git
3
+ revision: 899ec8b6c699330d7804f91253e37beb610d097e
4
+ branch: nested-commit-callbacks
5
+ specs:
6
+ test_after_commit (0.3.0)
7
+ activerecord (>= 3.2)
8
+
9
+ PATH
10
+ remote: ../../
11
+ specs:
12
+ after_transaction_commit (1.1.0)
13
+ activerecord (>= 4.0)
14
+
15
+ GEM
16
+ remote: https://rubygems.org/
17
+ specs:
18
+ activemodel (5.0.0.1)
19
+ activesupport (= 5.0.0.1)
20
+ activerecord (5.0.0.1)
21
+ activemodel (= 5.0.0.1)
22
+ activesupport (= 5.0.0.1)
23
+ arel (~> 7.0)
24
+ activesupport (5.0.0.1)
25
+ concurrent-ruby (~> 1.0, >= 1.0.2)
26
+ i18n (~> 0.7)
27
+ minitest (~> 5.1)
28
+ tzinfo (~> 1.1)
29
+ arel (7.1.3)
30
+ bump (0.5.3)
31
+ concurrent-ruby (1.0.2)
32
+ diff-lcs (1.2.5)
33
+ i18n (0.7.0)
34
+ minitest (5.9.1)
35
+ rake (11.3.0)
36
+ rspec (3.5.0)
37
+ rspec-core (~> 3.5.0)
38
+ rspec-expectations (~> 3.5.0)
39
+ rspec-mocks (~> 3.5.0)
40
+ rspec-core (3.5.4)
41
+ rspec-support (~> 3.5.0)
42
+ rspec-expectations (3.5.0)
43
+ diff-lcs (>= 1.2.0, < 2.0)
44
+ rspec-support (~> 3.5.0)
45
+ rspec-mocks (3.5.0)
46
+ diff-lcs (>= 1.2.0, < 2.0)
47
+ rspec-support (~> 3.5.0)
48
+ rspec-support (3.5.0)
49
+ sqlite3 (1.3.11)
50
+ thread_safe (0.3.5)
51
+ tzinfo (1.2.2)
52
+ thread_safe (~> 0.1)
53
+ wwtd (1.3.0)
54
+
55
+ PLATFORMS
56
+ ruby
57
+
58
+ DEPENDENCIES
59
+ activerecord (~> 5.0.0)
60
+ after_transaction_commit!
61
+ bump
62
+ bundler (~> 1.11)
63
+ rake (~> 11.0)
64
+ rspec
65
+ sqlite3
66
+ test_after_commit!
67
+ wwtd
68
+
69
+ BUNDLED WITH
70
+ 1.12.5
@@ -15,22 +15,12 @@ RSpec.configure do |config|
15
15
  config.around do |example|
16
16
  # open a transaction without using .transaction as activerecord use_transactional_fixtures does
17
17
  # code taken from https://github.com/grosser/test_after_commit/blob/master/spec/spec_helper.rb
18
- if ActiveRecord::VERSION::MAJOR > 3
19
- connection = ActiveRecord::Base.connection_handler.connection_pool_list.map(&:connection).first
20
- connection.begin_transaction :joinable => false
21
- else
22
- connection = ActiveRecord::Base.connection_handler.connection_pools.values.map(&:connection).first
23
- connection.increment_open_transactions
24
- connection.transaction_joinable = false
25
- connection.begin_db_transaction
26
- end
18
+ connection = ActiveRecord::Base.connection_handler.connection_pool_list.map(&:connection).first
19
+ connection.begin_transaction :joinable => false
27
20
 
28
21
  example.call
29
22
 
30
23
  connection.rollback_db_transaction
31
- if ActiveRecord::VERSION::MAJOR == 3
32
- connection.decrement_open_transactions
33
- end
34
24
  end
35
25
  end
36
26
  end
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: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Palmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-29 00:00:00.000000000 Z
11
+ date: 2016-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.2'
19
+ version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '3.2'
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bump
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.6'
47
+ version: '1.11'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.6'
54
+ version: '1.11'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '11.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '11.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -126,19 +126,18 @@ files:
126
126
  - after_transaction_commit.gemspec
127
127
  - lib/after_transaction_commit.rb
128
128
  - lib/after_transaction_commit/database_statements.rb
129
- - lib/after_transaction_commit/rails3.rb
130
- - lib/after_transaction_commit/rails4.rb
129
+ - lib/after_transaction_commit/transaction.rb
131
130
  - lib/after_transaction_commit/version.rb
132
131
  - spec/after_transaction_commit_spec.rb
133
132
  - spec/database.rb
134
- - spec/gemfiles/32.gemfile
135
- - spec/gemfiles/32.gemfile.lock
136
133
  - spec/gemfiles/40.gemfile
137
134
  - spec/gemfiles/40.gemfile.lock
138
135
  - spec/gemfiles/41.gemfile
139
136
  - spec/gemfiles/41.gemfile.lock
140
137
  - spec/gemfiles/42.gemfile
141
138
  - spec/gemfiles/42.gemfile.lock
139
+ - spec/gemfiles/50.gemfile
140
+ - spec/gemfiles/50.gemfile.lock
142
141
  - spec/spec_helper.rb
143
142
  homepage: https://github.com/instructure/after_transaction_commit
144
143
  licenses:
@@ -152,7 +151,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
152
151
  requirements:
153
152
  - - ">="
154
153
  - !ruby/object:Gem::Version
155
- version: '0'
154
+ version: '2.1'
156
155
  required_rubygems_version: !ruby/object:Gem::Requirement
157
156
  requirements:
158
157
  - - ">="
@@ -160,19 +159,20 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
159
  version: '0'
161
160
  requirements: []
162
161
  rubyforge_project:
163
- rubygems_version: 2.4.1
162
+ rubygems_version: 2.5.1
164
163
  signing_key:
165
164
  specification_version: 4
166
165
  summary: ActiveRecord::Base.connection.after_transaction_commit { ... }
167
166
  test_files:
168
167
  - spec/after_transaction_commit_spec.rb
169
168
  - spec/database.rb
170
- - spec/gemfiles/32.gemfile
171
- - spec/gemfiles/32.gemfile.lock
172
169
  - spec/gemfiles/40.gemfile
173
170
  - spec/gemfiles/40.gemfile.lock
174
171
  - spec/gemfiles/41.gemfile
175
172
  - spec/gemfiles/41.gemfile.lock
176
173
  - spec/gemfiles/42.gemfile
177
174
  - spec/gemfiles/42.gemfile.lock
175
+ - spec/gemfiles/50.gemfile
176
+ - spec/gemfiles/50.gemfile.lock
178
177
  - spec/spec_helper.rb
178
+ has_rdoc:
@@ -1,16 +0,0 @@
1
- ActiveRecord::ConnectionAdapters::DatabaseStatements.class_eval do
2
- def commit_transaction_records_with_callbacks(*a)
3
- commit_transaction_records_without_callbacks(*a)
4
- _run_after_transaction_commit_callbacks
5
- end
6
-
7
- def rollback_transaction_records_with_callbacks(rollback)
8
- rollback_transaction_records_without_callbacks(rollback)
9
- if rollback || (_transaction_test_mode? && (@test_open_transactions || 0) == 0)
10
- _remove_after_transaction_commit_callbacks
11
- end
12
- end
13
-
14
- alias_method_chain :commit_transaction_records, :callbacks
15
- alias_method_chain :rollback_transaction_records, :callbacks
16
- end
@@ -1,23 +0,0 @@
1
- _ = ActiveRecord::ConnectionAdapters::RealTransaction # force autoloading if necessary
2
-
3
- klass = defined?(ActiveRecord::ConnectionAdapters::OpenTransaction) ?
4
- ActiveRecord::ConnectionAdapters::OpenTransaction : # rails < 4.2
5
- ActiveRecord::ConnectionAdapters::Transaction # rails >= 4.2
6
-
7
- klass.class_eval do
8
- def rollback_records_with_callbacks
9
- rollback_records_without_callbacks
10
- if self.is_a?(ActiveRecord::ConnectionAdapters::RealTransaction) ||
11
- (connection.send(:_transaction_test_mode?) && connection.send(:_test_open_transactions) == 0)
12
- connection.send(:_remove_after_transaction_commit_callbacks)
13
- end
14
- end
15
-
16
- def commit_records_with_callbacks
17
- commit_records_without_callbacks
18
- connection.send(:_run_after_transaction_commit_callbacks)
19
- end
20
-
21
- alias_method_chain :rollback_records, :callbacks
22
- alias_method_chain :commit_records, :callbacks
23
- end
@@ -1,62 +0,0 @@
1
- GIT
2
- remote: https://github.com/codekitchen/test_after_commit.git
3
- revision: 899ec8b6c699330d7804f91253e37beb610d097e
4
- branch: nested-commit-callbacks
5
- specs:
6
- test_after_commit (0.3.0)
7
- activerecord (>= 3.2)
8
-
9
- PATH
10
- remote: ../../
11
- specs:
12
- after_transaction_commit (1.0.0)
13
- activerecord (>= 3.2)
14
-
15
- GEM
16
- remote: https://rubygems.org/
17
- specs:
18
- activemodel (3.2.19)
19
- activesupport (= 3.2.19)
20
- builder (~> 3.0.0)
21
- activerecord (3.2.19)
22
- activemodel (= 3.2.19)
23
- activesupport (= 3.2.19)
24
- arel (~> 3.0.2)
25
- tzinfo (~> 0.3.29)
26
- activesupport (3.2.19)
27
- i18n (~> 0.6, >= 0.6.4)
28
- multi_json (~> 1.0)
29
- arel (3.0.3)
30
- builder (3.0.4)
31
- diff-lcs (1.2.5)
32
- i18n (0.6.11)
33
- multi_json (1.10.1)
34
- rake (10.3.2)
35
- rspec (3.1.0)
36
- rspec-core (~> 3.1.0)
37
- rspec-expectations (~> 3.1.0)
38
- rspec-mocks (~> 3.1.0)
39
- rspec-core (3.1.4)
40
- rspec-support (~> 3.1.0)
41
- rspec-expectations (3.1.2)
42
- diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.1.0)
44
- rspec-mocks (3.1.2)
45
- rspec-support (~> 3.1.0)
46
- rspec-support (3.1.1)
47
- sqlite3 (1.3.9)
48
- tzinfo (0.3.41)
49
- wwtd (0.5.5)
50
-
51
- PLATFORMS
52
- ruby
53
-
54
- DEPENDENCIES
55
- activerecord (~> 3.2.19)
56
- after_transaction_commit!
57
- bundler (~> 1.6)
58
- rake (~> 10.0)
59
- rspec
60
- sqlite3
61
- test_after_commit!
62
- wwtd