ar_transaction_changes 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -3
- data/Appraisals +9 -5
- data/gemfiles/rails_3_2.gemfile +1 -1
- data/gemfiles/{rails_4_1_stable.gemfile → rails_4_0.gemfile} +1 -1
- data/gemfiles/{rails_4_0_5.gemfile → rails_4_1.gemfile} +1 -1
- data/gemfiles/rails_4_2.gemfile +7 -0
- data/lib/ar_transaction_changes.rb +32 -6
- data/lib/ar_transaction_changes/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b76ac095327c8c254909a40073ea452d63697545
|
4
|
+
data.tar.gz: 678ec4927dc1820bc18f20487e4198207934bc31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5bf2e245da73bf180d81e55a4c39841301d43d8a2ec440c5f69662f9335ac4dc776acf72efffc91acea4e1fe2cf26a097acab5c62720bc6d8ef139bd5a4841d
|
7
|
+
data.tar.gz: ac3c601561b34d03c56cafb1f4048e1d0e5e4096ccc590a7bed7b9ca45fad0b37f18608573c093c32a9022145ccace87df41c913945e667de823403f1b48b935
|
data/.travis.yml
CHANGED
@@ -2,12 +2,13 @@ language: ruby
|
|
2
2
|
rvm:
|
3
3
|
- 1.9.3
|
4
4
|
- 2.0.0
|
5
|
-
- 2.1.
|
5
|
+
- 2.1.5
|
6
6
|
|
7
7
|
gemfile:
|
8
8
|
- gemfiles/rails_3_2.gemfile
|
9
|
-
- gemfiles/
|
10
|
-
- gemfiles/
|
9
|
+
- gemfiles/rails_4_0.gemfile
|
10
|
+
- gemfiles/rails_4_1.gemfile
|
11
|
+
- gemfiles/rails_4_2.gemfile
|
11
12
|
|
12
13
|
services:
|
13
14
|
- mysql
|
data/Appraisals
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
appraise "rails-3-2" do
|
2
|
-
gem "rails", "~> 3.2"
|
2
|
+
gem "rails", "~> 3.2.21"
|
3
3
|
end
|
4
4
|
|
5
|
-
appraise "rails-4-0
|
6
|
-
gem "rails", "4.0.
|
5
|
+
appraise "rails-4-0" do
|
6
|
+
gem "rails", "~> 4.0.12"
|
7
7
|
end
|
8
8
|
|
9
|
-
appraise "rails-4-1
|
10
|
-
gem "rails", "~> 4.1.
|
9
|
+
appraise "rails-4-1" do
|
10
|
+
gem "rails", "~> 4.1.8"
|
11
|
+
end
|
12
|
+
|
13
|
+
appraise "rails-4-2" do
|
14
|
+
gem "rails", "~> 4.2.0.rc1"
|
11
15
|
end
|
data/gemfiles/rails_3_2.gemfile
CHANGED
@@ -1,16 +1,42 @@
|
|
1
1
|
require "ar_transaction_changes/version"
|
2
2
|
|
3
3
|
module ArTransactionChanges
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
when :create, :update
|
4
|
+
if (ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR >= 2) || ActiveRecord::VERSION::MAJOR > 4
|
5
|
+
def _run_create_callbacks
|
6
|
+
ret = super
|
8
7
|
store_transaction_changed_attributes if ret != false
|
9
|
-
|
8
|
+
ret
|
9
|
+
end
|
10
|
+
|
11
|
+
def _run_update_callbacks
|
12
|
+
ret = super
|
13
|
+
store_transaction_changed_attributes if ret != false
|
14
|
+
ret
|
15
|
+
end
|
16
|
+
|
17
|
+
def _run_commit_callbacks
|
18
|
+
super
|
19
|
+
ensure
|
10
20
|
@transaction_changed_attributes = nil
|
11
21
|
end
|
12
22
|
|
13
|
-
|
23
|
+
def _run_rollback_callbacks
|
24
|
+
super
|
25
|
+
ensure
|
26
|
+
@transaction_changed_attributes = nil
|
27
|
+
end
|
28
|
+
else
|
29
|
+
def run_callbacks(kind)
|
30
|
+
ret = super
|
31
|
+
case kind.to_sym
|
32
|
+
when :create, :update
|
33
|
+
store_transaction_changed_attributes if ret != false
|
34
|
+
when :commit, :rollback
|
35
|
+
@transaction_changed_attributes = nil
|
36
|
+
end
|
37
|
+
|
38
|
+
ret
|
39
|
+
end
|
14
40
|
end
|
15
41
|
|
16
42
|
def transaction_changed_attributes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ar_transaction_changes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dylan Thacker-Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -89,8 +89,9 @@ files:
|
|
89
89
|
- Rakefile
|
90
90
|
- ar_transaction_changes.gemspec
|
91
91
|
- gemfiles/rails_3_2.gemfile
|
92
|
-
- gemfiles/
|
93
|
-
- gemfiles/
|
92
|
+
- gemfiles/rails_4_0.gemfile
|
93
|
+
- gemfiles/rails_4_1.gemfile
|
94
|
+
- gemfiles/rails_4_2.gemfile
|
94
95
|
- lib/ar_transaction_changes.rb
|
95
96
|
- lib/ar_transaction_changes/version.rb
|
96
97
|
- test/database.yml.default
|