wipe_out 1.0.0 → 1.0.1

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: eafa15a844d625664e5cd81d01e921514a84f34a2d488efedd950a5fadc77adb
4
- data.tar.gz: 92ebfff20053d46b9e2629e1c00dc3097073874083bc0d46bb077e43d1418346
3
+ metadata.gz: b552b009a241e5df1a9df23fadf58f1a62da0439e4f0346c9257e7e339aaa497
4
+ data.tar.gz: 5e5555fb5e96386ff24338180445d702b63d2049e0508e3a9b80d517eb08a591
5
5
  SHA512:
6
- metadata.gz: 2177346bc816df8cd6a270abd66e8c660db21297e4fead9500c912792f2bb4f76fd12666ae7029091b4a3c71a430974087992d9615c155d6811f6165e03b3b27
7
- data.tar.gz: dc02b071110c0c5963f44a132de42def2ee24e317b4623eb0106eee64739160c93e1350065083b023e5e5ab3a7812819febc864ca07474eb00206de0fbc36448
6
+ metadata.gz: 05b7369f04f3960bdc8f9d42187f7c1034854074f74cdca6bab4715ebc8bd41851ace94841e7207cb0aa0f7eb17c77265d8b525c995bfd4b61c40143b52823ec
7
+ data.tar.gz: 2c8220d195903b722b97bd74da64c05c4d55303fc7d35cc2f416396de0f838106f5fcd0756bbcea569f2fba0ff7b8f74debf411d5d92534a4a521471204a22c1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.0.1
4
+
5
+ Fix issue with callbacks being executed multiple times in child plans
6
+
3
7
  ## v1.0.0
4
8
 
5
9
  Initial release, see docs:
data/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # WipeOut
2
2
 
3
- Library for removing and clearing data in Rails ActiveRecord models.
3
+ [![Gem Version](https://badge.fury.io/rb/wipe_out.svg)](https://rubygems.org/gems/wipe_out)
4
+
5
+ ![Library for removing and clearing data in Rails ActiveRecord models](https://www.globalapptesting.com/hs-fs/hubfs/blog_post_title_image_1-14.jpeg?width=1985&name=blog_post_title_image_1-14.jpeg)
6
+
7
+ Release blog post, [ActiveRecord models: How to remove data in GDPR compliant way](https://www.globalapptesting.com/engineering/activerecord-models-how-to-remove-data-in-gdpr-compliant-way)
4
8
 
5
9
  ## Installation
6
10
 
@@ -26,7 +26,6 @@ module WipeOut
26
26
  end
27
27
 
28
28
  def subexecution(sub_plan, record)
29
- plan.callbacks.each { |callback| sub_plan.add_callback(callback) }
30
29
  self.class.new(sub_plan, record, config)
31
30
  end
32
31
  end
@@ -66,12 +66,17 @@ module WipeOut
66
66
  # @return [nil]
67
67
  def relation(name, plan = nil, plans: nil, &block)
68
68
  if plans
69
+ plans.each do |build_plan|
70
+ forward_callbacks(@plan, build_plan.plan)
71
+ end
72
+
69
73
  @plan.add_relation_union(name, plans.map(&:plan), &block)
70
74
  else
71
75
  plan ||= Plan.new(@plan.config)
72
76
  plan = plan.plan if plan.is_a?(BuiltPlan)
73
77
  dsl = Dsl.new(plan)
74
78
  dsl.instance_exec(&block) if block.present?
79
+ forward_callbacks(@plan, plan)
75
80
 
76
81
  @plan.add_relation(name, dsl.plan)
77
82
  end
@@ -112,6 +117,11 @@ module WipeOut
112
117
  def add_callback(callback)
113
118
  plan.add_callback(callback)
114
119
  end
120
+
121
+ # @!visibility private
122
+ def forward_callbacks(source_plan, destination_plan)
123
+ source_plan.callbacks.each { |callback| destination_plan.add_callback(callback) }
124
+ end
115
125
  end
116
126
  end
117
127
  end
@@ -1,3 +1,3 @@
1
1
  module WipeOut
2
- VERSION = "1.0.0".freeze
2
+ VERSION = "1.0.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wipe_out
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Foryś
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-08-12 00:00:00.000000000 Z
12
+ date: 2021-12-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: attr_extras