transaction_changes 2.2.1 → 2.2.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/transaction_changes.rb +5 -5
- data/lib/transaction_changes/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d6661775605f6bd248398cfc8941d089178288668f4e1de6a322800900b4de57
|
|
4
|
+
data.tar.gz: 8e4ed6ceb477a28cdae6b4a477781c68ba0bb693885c09828ad19d38a8f80e17
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ccdfbfcec630629dd81acabf2f427d82bc199ec041f0a8cf66c362667e6f6015c9eef90f21b3d93d82a6718cc90dfaf0c020218743b7c093814c375c1cc8fc4e
|
|
7
|
+
data.tar.gz: 40e6e3ebbd89647be9d1a719eab66edb3dc3fe0a11599a66ef3a8e30e00ca075f0ce5b0026b5f341c7d529128893e86617fafa2854fb7b56a7a4b8b61f135ba7
|
data/Gemfile.lock
CHANGED
data/lib/transaction_changes.rb
CHANGED
|
@@ -7,14 +7,10 @@ module TransactionChanges
|
|
|
7
7
|
include ActiveSupport::Callbacks
|
|
8
8
|
|
|
9
9
|
included do
|
|
10
|
-
after_save
|
|
10
|
+
after_save :accumulate_changes
|
|
11
11
|
set_callback :commit, :before, :setting_variables
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
def setting_variables
|
|
15
|
-
@new_transaction_changes, @old_transaction_changes = HashWithIndifferentAccess.new, @new_transaction_changes
|
|
16
|
-
end
|
|
17
|
-
|
|
18
14
|
def transaction_changes
|
|
19
15
|
@old_transaction_changes || HashWithIndifferentAccess.new
|
|
20
16
|
end
|
|
@@ -33,6 +29,10 @@ module TransactionChanges
|
|
|
33
29
|
|
|
34
30
|
private
|
|
35
31
|
|
|
32
|
+
def setting_variables
|
|
33
|
+
@new_transaction_changes, @old_transaction_changes = HashWithIndifferentAccess.new, @new_transaction_changes
|
|
34
|
+
end
|
|
35
|
+
|
|
36
36
|
def accumulate_changes
|
|
37
37
|
@new_transaction_changes ||= HashWithIndifferentAccess.new
|
|
38
38
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: transaction_changes
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.2.
|
|
4
|
+
version: 2.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Priyanka
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-06-
|
|
11
|
+
date: 2018-06-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|