activerecord-nested_attribute_destruction 0.1.1 → 0.2.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 +4 -4
- data/CHANGELOG.md +11 -0
- data/Gemfile.lock +1 -1
- data/lib/nested_attribute_destruction/monitor.rb +2 -4
- data/lib/nested_attribute_destruction/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: 6dac1a81884232bf32c0b31e8466dba5861865729c326fdf4eb12fe1624c8105
|
|
4
|
+
data.tar.gz: 3cb0131d79043d18371cb85070923d8231909122f96bdf292ea691c81297e277
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3bb208ad070ef33d02fe41af242b0caef248d4fb37dc9a90f25e21360b88038422bb4699989296d5f109e0b98745589706d7c2af1b02392890dcd3abe13cdd50
|
|
7
|
+
data.tar.gz: 3be694ae9981724d5fb72a415c797d4ec63a8cb18eab22567e16d478b99f2976c1342578381fb734b00196d03c6abc059dac5f378ad125f1f6a4e67d6f993ce5
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.2.0] - 2022-01-24
|
|
4
|
+
|
|
5
|
+
**POSSIBLY BREAKING CHANGE**
|
|
6
|
+
|
|
7
|
+
Use `around_update` instead of `before_update` and `after_commit, on: :update`.
|
|
8
|
+
|
|
9
|
+
In some situations, our `after_commit` would be run after `after_commit`
|
|
10
|
+
callbacks that were defined in the user application.
|
|
11
|
+
|
|
12
|
+
By using `around_update`, our callback finishes before any `after_*` callbacks are called.
|
|
13
|
+
|
|
3
14
|
## [0.1.1] - 2022-01-17
|
|
4
15
|
|
|
5
16
|
Fixed bug where the monitor might not have been created yet when it is accessed.
|
data/Gemfile.lock
CHANGED
|
@@ -30,11 +30,9 @@ module NestedAttributeDestruction
|
|
|
30
30
|
@nested_attribute_destruction_monitor = NestedAttributeDestruction::Monitor.new
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
klass.
|
|
33
|
+
klass.around_update do |obj, block|
|
|
34
34
|
@nested_attribute_destruction_monitor.send(:store_attributes_marked_for_destruction, obj)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
klass.after_commit(on: :update) do
|
|
35
|
+
block.call
|
|
38
36
|
@nested_attribute_destruction_monitor.send(:save_succeeded)
|
|
39
37
|
end
|
|
40
38
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activerecord-nested_attribute_destruction
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brandon Conway
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-01-
|
|
11
|
+
date: 2022-01-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|