transaction_changes 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -4
- data/lib/transaction_changes/version.rb +1 -1
- data/lib/transaction_changes.rb +4 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 909f2c5f55116fa8163c6c648079c662f86daead68b2154fefe7ffe273c61813
|
4
|
+
data.tar.gz: 364f496076c303016a1adb568b1ab84e9ffc5c4442c0cb84e7ccb03935755b68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a66bc5796ca60e6218a31495a2a4d347ee24d3af801ace209a19bf61d21f241321b638ebca3d8593414fa4788b6548c75ea3137f22a4d516975ccc20b454823
|
7
|
+
data.tar.gz: 5f8ef2f50ef0155d19c6ea9ccd7b1cf478464c87a379ecd58d713d8660b1fef7199b9b0736e2f81cc9762a37a396357040ad2164f4b4244d93566df8d4a44f43
|
data/README.md
CHANGED
@@ -33,10 +33,6 @@ class Profile < ActiveRecord::Base
|
|
33
33
|
end
|
34
34
|
```
|
35
35
|
|
36
|
-
## Important Notes
|
37
|
-
|
38
|
-
`include TransactionChanges` should be written after all the after_commit callbacks
|
39
|
-
|
40
36
|
## Development
|
41
37
|
|
42
38
|
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.
|
data/lib/transaction_changes.rb
CHANGED
@@ -29,10 +29,13 @@ module TransactionChanges
|
|
29
29
|
|
30
30
|
def accumulate_changes
|
31
31
|
@new_transaction_changes ||= HashWithIndifferentAccess.new
|
32
|
-
|
32
|
+
|
33
|
+
attribute_changes = ::ActiveRecord.respond_to?(:version) && ActiveRecord.version.to_s.to_f >= 5.1 ? self.saved_changes : self.changes
|
33
34
|
attribute_changes.each do |key, value|
|
34
35
|
@new_transaction_changes[key] = value
|
35
36
|
end
|
36
37
|
end
|
37
38
|
|
38
39
|
end
|
40
|
+
|
41
|
+
|