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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ceaff9a731ffccd9d26e122b49d69936b6d4401c05f159740a455494dfecb9bf
4
- data.tar.gz: 32cb47ef8c9efa02f89141952cf914bad2ce72b39408630283bca21ea3011429
3
+ metadata.gz: 6dac1a81884232bf32c0b31e8466dba5861865729c326fdf4eb12fe1624c8105
4
+ data.tar.gz: 3cb0131d79043d18371cb85070923d8231909122f96bdf292ea691c81297e277
5
5
  SHA512:
6
- metadata.gz: 3fcb0ff80ca9b0e6af312ddb125f463e01a289eb9c8429f077a8540c96004c6d49d475bbff8b3b53a6a067e925f41dd5a231a54a61879a02efea2c3b64a7fe60
7
- data.tar.gz: 4d1faccd22aaacbb84180d0100289dad76208684c9e06c769f531783ce921f929dd8968a13861d2f35203bec68f8203a86011a357baceea9b6ee71e6efbc3f72
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activerecord-nested_attribute_destruction (0.1.1)
4
+ activerecord-nested_attribute_destruction (0.2.0)
5
5
  activerecord (>= 5.2.0)
6
6
 
7
7
  GEM
@@ -30,11 +30,9 @@ module NestedAttributeDestruction
30
30
  @nested_attribute_destruction_monitor = NestedAttributeDestruction::Monitor.new
31
31
  end
32
32
 
33
- klass.before_update do |obj|
33
+ klass.around_update do |obj, block|
34
34
  @nested_attribute_destruction_monitor.send(:store_attributes_marked_for_destruction, obj)
35
- end
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NestedAttributeDestruction
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
5
5
  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.1.1
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-17 00:00:00.000000000 Z
11
+ date: 2022-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord