after_commit_everywhere 0.1.0
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 +7 -0
- data/.gitignore +13 -0
- data/.rspec +3 -0
- data/.rubocop.yml +41 -0
- data/.travis.yml +25 -0
- data/Appraisals +17 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +21 -0
- data/README.md +130 -0
- data/Rakefile +8 -0
- data/after_commit_everywhere.gemspec +39 -0
- data/bin/console +11 -0
- data/bin/setup +8 -0
- data/gemfiles/.bundle/config +2 -0
- data/gemfiles/activerecord_5_0.gemfile +7 -0
- data/gemfiles/activerecord_5_1.gemfile +7 -0
- data/gemfiles/activerecord_5_2.gemfile +7 -0
- data/gemfiles/activerecord_master.gemfile +7 -0
- data/lib/after_commit_everywhere.rb +90 -0
- data/lib/after_commit_everywhere/version.rb +5 -0
- data/lib/after_commit_everywhere/wrap.rb +35 -0
- metadata +177 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6eb14b053c0170cfb885875b2b5c0f50fbd1d84f09847b939e87eb875aac28a4
|
4
|
+
data.tar.gz: 1610ebf77543a2d55ce3208ecc7d739667544ef6dfa5dc4f72f86d5b8e53c4ff
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f308a4913a2b8557e3027cbdebe357d45cede83d4a0f818afb598d0157610c72bc4777a18409402b9c67f63a1e50b803a6bc87c34487f473e514799df0306cf6
|
7
|
+
data.tar.gz: f3aaddff157104f2afab4924cc84d94b83c02028e85b5119a98ec8e76aadb003133e3f3b24f4bd8dd062ffa5a0b861cd80d439db098e653e421160370cc40764
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.3
|
3
|
+
UseCache: false
|
4
|
+
DisplayCopNames: true
|
5
|
+
|
6
|
+
Metrics/LineLength:
|
7
|
+
Max: 100
|
8
|
+
# To make it possible to copy or click on URIs in the code, we allow lines
|
9
|
+
# contaning a URI to be longer than Max.
|
10
|
+
AllowURI: true
|
11
|
+
URISchemes:
|
12
|
+
- http
|
13
|
+
- https
|
14
|
+
Enabled: true
|
15
|
+
|
16
|
+
Metrics/AbcSize:
|
17
|
+
Max: 30
|
18
|
+
|
19
|
+
Metrics/MethodLength:
|
20
|
+
Max: 25
|
21
|
+
|
22
|
+
Metrics/BlockLength:
|
23
|
+
Exclude:
|
24
|
+
- "spec/**/*.*"
|
25
|
+
- "*.gemspec"
|
26
|
+
|
27
|
+
Lint/HandleExceptions:
|
28
|
+
Exclude:
|
29
|
+
- "spec/**/*.*"
|
30
|
+
|
31
|
+
Style/TrailingCommaInArguments:
|
32
|
+
Description: 'Checks for trailing comma in argument lists.'
|
33
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma'
|
34
|
+
Enabled: true
|
35
|
+
EnforcedStyleForMultiline: consistent_comma
|
36
|
+
|
37
|
+
Style/TrailingCommaInLiteral:
|
38
|
+
Description: 'Checks for trailing comma in array and hash literals.'
|
39
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
40
|
+
Enabled: true
|
41
|
+
EnforcedStyleForMultiline: consistent_comma
|
data/.travis.yml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
cache: bundler
|
2
|
+
sudo: false
|
3
|
+
language: ruby
|
4
|
+
|
5
|
+
addons:
|
6
|
+
apt:
|
7
|
+
sources:
|
8
|
+
- travis-ci/sqlite3
|
9
|
+
packages:
|
10
|
+
- sqlite3
|
11
|
+
|
12
|
+
matrix:
|
13
|
+
include:
|
14
|
+
- rvm: 2.5.0
|
15
|
+
gemfile: gemfiles/activerecord_5_0.gemfile
|
16
|
+
- rvm: 2.5.0
|
17
|
+
gemfile: gemfiles/activerecord_5_1.gemfile
|
18
|
+
- rvm: 2.5.0
|
19
|
+
gemfile: gemfiles/activerecord_5_2.gemfile
|
20
|
+
- rvm: 2.5.0
|
21
|
+
gemfile: gemfiles/activerecord_master.gemfile
|
22
|
+
- rvm: 2.4.3
|
23
|
+
gemfile: gemfiles/activerecord_5_2.gemfile
|
24
|
+
- rvm: 2.3.6
|
25
|
+
gemfile: gemfiles/activerecord_5_2.gemfile
|
data/Appraisals
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
appraise 'activerecord-5-0' do
|
4
|
+
gem 'activerecord', '~> 5.0.0'
|
5
|
+
end
|
6
|
+
|
7
|
+
appraise 'activerecord-5-1' do
|
8
|
+
gem 'activerecord', '~> 5.1.0'
|
9
|
+
end
|
10
|
+
|
11
|
+
appraise 'activerecord-5-2' do
|
12
|
+
gem 'activerecord', '~> 5.2.0.rc1'
|
13
|
+
end
|
14
|
+
|
15
|
+
appraise 'activerecord-master' do
|
16
|
+
gem 'activerecord', git: 'https://github.com/rails/rails.git'
|
17
|
+
end
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 Andrey Novikov
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
[](https://rubygems.org/gems/after_commit_everywhere)
|
2
|
+
[](https://travis-ci.org/Envek/after_commit_everywhere)
|
3
|
+
|
4
|
+
# `after_commit` everywhere
|
5
|
+
|
6
|
+
Allows to use ActiveRecord transactional callbacks outside of ActiveRecord models, literally everywhere in your application.
|
7
|
+
|
8
|
+
Inspired by these articles:
|
9
|
+
|
10
|
+
- https://dev.to/evilmartians/rails-aftercommit-everywhere--4j9g
|
11
|
+
- https://blog.arkency.com/2015/10/run-it-in-background-job-after-commit/
|
12
|
+
|
13
|
+
<a href="https://evilmartians.com/?utm_source=after_commit_everywhere&utm_campaign=project_page"><img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54"></a>
|
14
|
+
|
15
|
+
|
16
|
+
## Installation
|
17
|
+
|
18
|
+
Add this line to your application's Gemfile:
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
gem 'after_commit_everywhere'
|
22
|
+
```
|
23
|
+
|
24
|
+
And then execute:
|
25
|
+
|
26
|
+
$ bundle
|
27
|
+
|
28
|
+
Or install it yourself as:
|
29
|
+
|
30
|
+
$ gem install after_commit_everywhere
|
31
|
+
|
32
|
+
|
33
|
+
## Usage
|
34
|
+
|
35
|
+
Recommended usage is to include it to your base service class or anything:
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
class ServiceObjectBtw
|
39
|
+
include AfterCommitEverywhere
|
40
|
+
|
41
|
+
def call
|
42
|
+
ActiveRecord::Base.transaction do
|
43
|
+
after_commit { puts "We're all done!" }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
```
|
48
|
+
|
49
|
+
Or just extend it whenever you need it:
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
extend AfterCommitEverywhere
|
53
|
+
|
54
|
+
ActiveRecord::Base.transaction do
|
55
|
+
after_commit { puts "We're all done!" }
|
56
|
+
end
|
57
|
+
```
|
58
|
+
|
59
|
+
That's it!
|
60
|
+
|
61
|
+
But the main benefit is that it works with nested `transaction` blocks (may be even spread across many files in your codebase):
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
include AfterCommitEverywhere
|
65
|
+
|
66
|
+
ActiveRecord::Base.transaction do
|
67
|
+
puts "We're in transaction now"
|
68
|
+
|
69
|
+
ActiveRecord::Base.transaction do
|
70
|
+
puts "More transactions"
|
71
|
+
after_commit { puts "We're all done!" }
|
72
|
+
end
|
73
|
+
|
74
|
+
puts "Still in transaction…"
|
75
|
+
end
|
76
|
+
```
|
77
|
+
|
78
|
+
Will output:
|
79
|
+
|
80
|
+
```
|
81
|
+
We're in transaction now
|
82
|
+
More transactions
|
83
|
+
Still in transaction…
|
84
|
+
We're all done!
|
85
|
+
```
|
86
|
+
|
87
|
+
### Available callbacks
|
88
|
+
|
89
|
+
#### `after_commit`
|
90
|
+
|
91
|
+
Will be executed right after outermost transaction have been successfully committed and data become available to other DBMS clients.
|
92
|
+
|
93
|
+
If called outside transaction will execute callback immediately.
|
94
|
+
|
95
|
+
#### `before_commit`
|
96
|
+
|
97
|
+
Will be executed right before outermost transaction will be commited _(I can't imagine use case for it but if you can, please open a pull request or issue)_.
|
98
|
+
|
99
|
+
If called outside transaction will execute callback immediately.
|
100
|
+
|
101
|
+
#### `after_rollback`
|
102
|
+
|
103
|
+
Will be executed right after transaction in which it have been declared was rolled back (this might be nested savepoint transaction block with `requires_new: true`).
|
104
|
+
|
105
|
+
If called outside transaction will raise an exception!
|
106
|
+
|
107
|
+
Please keep in mind ActiveRecord's [limitations for rolling back nested transactions](http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html#module-ActiveRecord::Transactions::ClassMethods-label-Nested+transactions).
|
108
|
+
|
109
|
+
### FAQ
|
110
|
+
|
111
|
+
#### Does it works with transactional_test or DatabaseCleaner
|
112
|
+
|
113
|
+
*Yes* but currently it is not tested (help wanted).
|
114
|
+
|
115
|
+
|
116
|
+
## Development
|
117
|
+
|
118
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
119
|
+
|
120
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
121
|
+
|
122
|
+
|
123
|
+
## Contributing
|
124
|
+
|
125
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/Envek/after_commit_everywhere.
|
126
|
+
|
127
|
+
|
128
|
+
## License
|
129
|
+
|
130
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'after_commit_everywhere/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'after_commit_everywhere'
|
9
|
+
spec.version = AfterCommitEverywhere::VERSION
|
10
|
+
spec.authors = ['Andrey Novikov']
|
11
|
+
spec.email = ['envek@envek.name']
|
12
|
+
|
13
|
+
spec.summary = <<~MSG.strip
|
14
|
+
Executes code after database commit wherever you want in your application
|
15
|
+
MSG
|
16
|
+
|
17
|
+
spec.description = <<~MSG.strip
|
18
|
+
Brings before_commit, after_commit, and after_rollback transactional \
|
19
|
+
callbacks outside of your ActiveRecord models.
|
20
|
+
MSG
|
21
|
+
spec.homepage = 'https://github.com/Envek/after_commit_everywhere'
|
22
|
+
spec.license = 'MIT'
|
23
|
+
|
24
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
25
|
+
f.match(%r{^(test|spec|features)/})
|
26
|
+
end
|
27
|
+
spec.bindir = 'exe'
|
28
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ['lib']
|
30
|
+
|
31
|
+
spec.add_dependency 'activerecord', '>= 5.0'
|
32
|
+
spec.add_development_dependency 'appraisal'
|
33
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
34
|
+
spec.add_development_dependency 'pry'
|
35
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
36
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
37
|
+
spec.add_development_dependency 'rubocop'
|
38
|
+
spec.add_development_dependency 'sqlite3'
|
39
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'after_commit_everywhere'
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
require 'pry'
|
11
|
+
Pry.start
|
data/bin/setup
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_record'
|
4
|
+
|
5
|
+
require 'after_commit_everywhere/version'
|
6
|
+
require 'after_commit_everywhere/wrap'
|
7
|
+
|
8
|
+
# Module allowing to use ActiveRecord transactional callbacks outside of
|
9
|
+
# ActiveRecord models, literally everywhere in your application.
|
10
|
+
#
|
11
|
+
# Include it to your classes (e.g. your base service object class or whatever)
|
12
|
+
module AfterCommitEverywhere
|
13
|
+
class NotInTransaction < RuntimeError; end
|
14
|
+
|
15
|
+
# Runs +callback+ after successful commit of outermost transaction for
|
16
|
+
# database +connection+.
|
17
|
+
#
|
18
|
+
# If called outside transaction it will execute callback immediately.
|
19
|
+
#
|
20
|
+
# @param connection [ActiveRecord::ConnectionAdapters::AbstractAdapter]
|
21
|
+
# @param callback [#call] Callback to be executed
|
22
|
+
# @return void
|
23
|
+
def after_commit(connection: ActiveRecord::Base.connection, &callback)
|
24
|
+
AfterCommitEverywhere.register_callback(
|
25
|
+
connection: connection,
|
26
|
+
name: __callee__,
|
27
|
+
callback: callback,
|
28
|
+
no_tx_action: :warn,
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
# Runs +callback+ before committing of outermost transaction for +connection+.
|
33
|
+
#
|
34
|
+
# If called outside transaction it will execute callback immediately.
|
35
|
+
#
|
36
|
+
# @param connection [ActiveRecord::ConnectionAdapters::AbstractAdapter]
|
37
|
+
# @param callback [#call] Callback to be executed
|
38
|
+
# @return void
|
39
|
+
def before_commit(connection: ActiveRecord::Base.connection, &callback)
|
40
|
+
AfterCommitEverywhere.register_callback(
|
41
|
+
connection: connection,
|
42
|
+
name: __callee__,
|
43
|
+
callback: callback,
|
44
|
+
no_tx_action: :warn,
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
# Runs +callback+ after rolling back of transaction or savepoint (if declared
|
49
|
+
# in nested transaction) for database +connection+.
|
50
|
+
#
|
51
|
+
# Caveat: do not raise +ActivRecord::Rollback+ in nested transaction block!
|
52
|
+
# See http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html#module-ActiveRecord::Transactions::ClassMethods-label-Nested+transactions
|
53
|
+
#
|
54
|
+
# @param connection [ActiveRecord::ConnectionAdapters::AbstractAdapter]
|
55
|
+
# @param callback [#call] Callback to be executed
|
56
|
+
# @return void
|
57
|
+
# @raise [NotInTransaction] if called outside transaction.
|
58
|
+
def after_rollback(connection: ActiveRecord::Base.connection, &callback)
|
59
|
+
AfterCommitEverywhere.register_callback(
|
60
|
+
connection: connection,
|
61
|
+
name: __callee__,
|
62
|
+
callback: callback,
|
63
|
+
no_tx_action: :exception,
|
64
|
+
)
|
65
|
+
end
|
66
|
+
|
67
|
+
class << self
|
68
|
+
def register_callback(connection:, name:, no_tx_action:, callback:)
|
69
|
+
raise ArgumentError, "Provide callback to #{name}" unless callback
|
70
|
+
unless in_transaction?(connection)
|
71
|
+
case no_tx_action
|
72
|
+
when :warn
|
73
|
+
warn "#{name}: No transaction open. Executing callback immediately."
|
74
|
+
return callback.call
|
75
|
+
when :exception
|
76
|
+
raise NotInTransaction, "#{name} is useless outside transaction"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
wrap = Wrap.new(connection: connection, "#{name}": callback)
|
80
|
+
connection.add_transaction_record(wrap)
|
81
|
+
end
|
82
|
+
|
83
|
+
private
|
84
|
+
|
85
|
+
def in_transaction?(connection)
|
86
|
+
# service transactions (tests and database_cleaner) are not joinable
|
87
|
+
connection.transaction_open? && connection.current_transaction.joinable?
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AfterCommitEverywhere
|
4
|
+
# ActiveRecord model-like class to fake ActiveRecord to make it believe
|
5
|
+
# that it calls transactional callbacks on real model objects.
|
6
|
+
class Wrap
|
7
|
+
def initialize(connection: ActiveRecord::Base.connection, **handlers)
|
8
|
+
@connection = connection
|
9
|
+
@handlers = handlers
|
10
|
+
end
|
11
|
+
|
12
|
+
# rubocop: disable Naming/PredicateName
|
13
|
+
def has_transactional_callbacks?
|
14
|
+
true
|
15
|
+
end
|
16
|
+
# rubocop: enable Naming/PredicateName
|
17
|
+
|
18
|
+
def before_committed!(*)
|
19
|
+
@handlers[:before_commit]&.call
|
20
|
+
end
|
21
|
+
|
22
|
+
def committed!(*)
|
23
|
+
@handlers[:after_commit]&.call
|
24
|
+
end
|
25
|
+
|
26
|
+
def rolledback!(*)
|
27
|
+
@handlers[:after_rollback]&.call
|
28
|
+
end
|
29
|
+
|
30
|
+
# Required for +transaction(requires_new: true)+
|
31
|
+
def add_to_transaction(*)
|
32
|
+
@connection.add_transaction_record(self)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,177 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: after_commit_everywhere
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andrey Novikov
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-03-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activerecord
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: appraisal
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.16'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.16'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '10.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '10.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: sqlite3
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: Brings before_commit, after_commit, and after_rollback transactional callbacks
|
126
|
+
outside of your ActiveRecord models.
|
127
|
+
email:
|
128
|
+
- envek@envek.name
|
129
|
+
executables: []
|
130
|
+
extensions: []
|
131
|
+
extra_rdoc_files: []
|
132
|
+
files:
|
133
|
+
- ".gitignore"
|
134
|
+
- ".rspec"
|
135
|
+
- ".rubocop.yml"
|
136
|
+
- ".travis.yml"
|
137
|
+
- Appraisals
|
138
|
+
- Gemfile
|
139
|
+
- LICENSE.txt
|
140
|
+
- README.md
|
141
|
+
- Rakefile
|
142
|
+
- after_commit_everywhere.gemspec
|
143
|
+
- bin/console
|
144
|
+
- bin/setup
|
145
|
+
- gemfiles/.bundle/config
|
146
|
+
- gemfiles/activerecord_5_0.gemfile
|
147
|
+
- gemfiles/activerecord_5_1.gemfile
|
148
|
+
- gemfiles/activerecord_5_2.gemfile
|
149
|
+
- gemfiles/activerecord_master.gemfile
|
150
|
+
- lib/after_commit_everywhere.rb
|
151
|
+
- lib/after_commit_everywhere/version.rb
|
152
|
+
- lib/after_commit_everywhere/wrap.rb
|
153
|
+
homepage: https://github.com/Envek/after_commit_everywhere
|
154
|
+
licenses:
|
155
|
+
- MIT
|
156
|
+
metadata: {}
|
157
|
+
post_install_message:
|
158
|
+
rdoc_options: []
|
159
|
+
require_paths:
|
160
|
+
- lib
|
161
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - ">="
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
|
+
requirements:
|
168
|
+
- - ">="
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: '0'
|
171
|
+
requirements: []
|
172
|
+
rubyforge_project:
|
173
|
+
rubygems_version: 2.7.6
|
174
|
+
signing_key:
|
175
|
+
specification_version: 4
|
176
|
+
summary: Executes code after database commit wherever you want in your application
|
177
|
+
test_files: []
|