acts_as_paranoid 0.8.1 → 0.10.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: be004bb0de25cdda73697fa22c07d0a64e1d98c071506d4b0a608a3d3231e103
4
- data.tar.gz: 9334fe5730d07f94d087f3e6f1d4803126224a4106cc378d9f6263fc15295d93
3
+ metadata.gz: 992c8836d7fa518c06baf1be695fcad08a9f9332cbd25596041cdbcf7c61d525
4
+ data.tar.gz: 2deedb7d195a333cd869b60ada4fe9f91c3d68005a04470e5fb97115c3acb748
5
5
  SHA512:
6
- metadata.gz: c3e7ebd79d467118c9c91374088f3fe3a203ae6ca914fa036646fb77e7f4c1c9ba4e1c653dc2311ac1bd53bbf2517cb1a00ee06b32e0f09d6937bfb1ea8f6247
7
- data.tar.gz: 99c7d3d41d9a94b26d2fed6ce5b01ea2fddfbc09bd958d9ca990a7b2d92c466a876e23011db5f7fda02b4efb9cd417b9a8dfe62a432757e788e7a89c898dbcd0
6
+ metadata.gz: 120588d3f6db69ca22c70d554bb82fcad1fe6471e411df9711ba111ea8b63aba93fa312b60216fd033457e6ff6f9b2d8bbc2cd5d8ca276e0c0b1d3a4b6d5a159
7
+ data.tar.gz: 73eee9f04521fb530034d81dcdbe41a3bf8c84f83f0dfa37db26f38d8a66d89c681d0ba0cbf6aae2f3cb3fb5c0588678ea6de506137983ab9c07a5d5e2d637b7
data/CHANGELOG.md CHANGED
@@ -2,6 +2,33 @@
2
2
 
3
3
  Notable changes to this project will be documented in this file.
4
4
 
5
+ ## 0.10.0
6
+
7
+ * Support Ruby 3.0 through 3.3, dropping support for 2.7 ([#322] by [mvz])
8
+ * Use correct sqlite3 versions in tests ([#329] by [fatkodima])
9
+ * Do not load `ActiveRecord` too early ([#330] by [fatkodima])
10
+
11
+ [fatkodima]: https://github.com/fatkodima
12
+
13
+ [#322]: https://github.com/ActsAsParanoid/acts_as_paranoid/pull/322
14
+ [#329]: https://github.com/ActsAsParanoid/acts_as_paranoid/pull/329
15
+ [#330]: https://github.com/ActsAsParanoid/acts_as_paranoid/pull/330
16
+
17
+ ## 0.9.0
18
+
19
+ * Support JRuby 9.4 ([#299] by [Matijs van Zuijlen][mvz])
20
+ * Add support for Ruby 3.2 ([#300] by [Matijs van Zuijlen][mvz])
21
+ * Drop support for Ruby 2.6 ([#301] by [Matijs van Zuijlen][mvz])
22
+ * Support Rails 7.1 ([#312] and [#317] by [Matijs van Zuijlen][mvz])
23
+ * Drop support for Rails 5.2 and 6.0 ([#315] by [Matijs van Zuijlen][mvz])
24
+
25
+ [#299]: https://github.com/ActsAsParanoid/acts_as_paranoid/pull/299
26
+ [#300]: https://github.com/ActsAsParanoid/acts_as_paranoid/pull/300
27
+ [#301]: https://github.com/ActsAsParanoid/acts_as_paranoid/pull/301
28
+ [#312]: https://github.com/ActsAsParanoid/acts_as_paranoid/pull/312
29
+ [#315]: https://github.com/ActsAsParanoid/acts_as_paranoid/pull/315
30
+ [#317]: https://github.com/ActsAsParanoid/acts_as_paranoid/pull/317
31
+
5
32
  ## 0.8.1
6
33
 
7
34
  * Officially support Ruby 3.1 ([#268], by [Matijs van Zuijlen][mvz])
data/README.md CHANGED
@@ -9,11 +9,10 @@ recoverable later.
9
9
 
10
10
  ## Support
11
11
 
12
- **This branch targets Rails 5.2+ and Ruby 2.5+ only**
12
+ **This version targets Rails 6.1+ and Ruby 3.0+ only**
13
13
 
14
- If you're working with Rails 5.1 and earlier, or with Ruby 2.4 or earlier,
15
- please switch to the corresponding branch or require an older version of the
16
- `acts_as_paranoid` gem.
14
+ If you're working with Rails 6.0 and earlier, or with Ruby 2.7 or earlier,
15
+ please require an older version of the `acts_as_paranoid` gem.
17
16
 
18
17
  ### Known issues
19
18
 
@@ -24,7 +23,7 @@ please switch to the corresponding branch or require an older version of the
24
23
 
25
24
  ## Usage
26
25
 
27
- #### Install gem:
26
+ #### Install gem
28
27
 
29
28
  ```ruby
30
29
  gem 'acts_as_paranoid'
@@ -246,7 +245,7 @@ p1.recover #=> fails validation!
246
245
 
247
246
  ### Status
248
247
 
249
- A paranoid object could be deleted or destroyed fully.
248
+ A paranoid object could be deleted or destroyed fully.
250
249
 
251
250
  You can check if the object is deleted with the `deleted?` helper
252
251
 
@@ -74,9 +74,11 @@ module ActsAsParanoid
74
74
  "#{table_name}.#{paranoid_column}"
75
75
  end
76
76
 
77
+ DESTROYING_ASSOCIATION_DEPENDENCY_TYPES = [:destroy, :delete_all].freeze
78
+
77
79
  def dependent_associations
78
80
  reflect_on_all_associations.select do |a|
79
- [:destroy, :delete_all].include?(a.options[:dependent])
81
+ DESTROYING_ASSOCIATION_DEPENDENCY_TYPES.include?(a.options[:dependent])
80
82
  end
81
83
  end
82
84
 
@@ -310,7 +312,7 @@ module ActsAsParanoid
310
312
  end
311
313
 
312
314
  def each_counter_cached_association_reflection
313
- _reflections.each do |_name, reflection|
315
+ _reflections.each_value do |reflection|
314
316
  yield reflection if reflection.belongs_to? && reflection.counter_cache_column
315
317
  end
316
318
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActsAsParanoid
4
- VERSION = "0.8.1"
4
+ VERSION = "0.10.0"
5
5
  end
@@ -30,9 +30,7 @@ module ActsAsParanoid
30
30
  dependent_recovery_window: 2.minutes,
31
31
  double_tap_destroys_fully: true
32
32
  }
33
- if options[:column_type] == "string"
34
- paranoid_configuration.merge!(deleted_value: "deleted")
35
- end
33
+ paranoid_configuration[:deleted_value] = "deleted" if options[:column_type] == "string"
36
34
 
37
35
  paranoid_configuration.merge!(options) # user options
38
36
 
@@ -53,17 +51,19 @@ module ActsAsParanoid
53
51
  end
54
52
  end
55
53
 
56
- # Extend ActiveRecord's functionality
57
- ActiveRecord::Base.extend ActsAsParanoid
54
+ ActiveSupport.on_load(:active_record) do
55
+ # Extend ActiveRecord's functionality
56
+ extend ActsAsParanoid
58
57
 
59
- # Extend ActiveRecord::Base with paranoid associations
60
- ActiveRecord::Base.include ActsAsParanoid::Associations
58
+ # Extend ActiveRecord::Base with paranoid associations
59
+ include ActsAsParanoid::Associations
61
60
 
62
- # Override ActiveRecord::Relation's behavior
63
- ActiveRecord::Relation.include ActsAsParanoid::Relation
61
+ # Override ActiveRecord::Relation's behavior
62
+ ActiveRecord::Relation.include ActsAsParanoid::Relation
64
63
 
65
- # Push the recover callback onto the activerecord callback list
66
- ActiveRecord::Callbacks::CALLBACKS.push(:before_recover, :after_recover)
64
+ # Push the recover callback onto the activerecord callback list
65
+ ActiveRecord::Callbacks::CALLBACKS.push(:before_recover, :after_recover)
67
66
 
68
- ActiveRecord::Reflection::AssociationReflection
69
- .prepend ActsAsParanoid::AssociationReflection
67
+ ActiveRecord::Reflection::AssociationReflection
68
+ .prepend ActsAsParanoid::AssociationReflection
69
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_paranoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Scott
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-04-22 00:00:00.000000000 Z
13
+ date: 2024-05-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -18,40 +18,40 @@ dependencies:
18
18
  requirements:
19
19
  - - ">="
20
20
  - !ruby/object:Gem::Version
21
- version: '5.2'
21
+ version: '6.1'
22
22
  - - "<"
23
23
  - !ruby/object:Gem::Version
24
- version: '7.1'
24
+ version: '7.2'
25
25
  type: :runtime
26
26
  prerelease: false
27
27
  version_requirements: !ruby/object:Gem::Requirement
28
28
  requirements:
29
29
  - - ">="
30
30
  - !ruby/object:Gem::Version
31
- version: '5.2'
31
+ version: '6.1'
32
32
  - - "<"
33
33
  - !ruby/object:Gem::Version
34
- version: '7.1'
34
+ version: '7.2'
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: activesupport
37
37
  requirement: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: '5.2'
41
+ version: '6.1'
42
42
  - - "<"
43
43
  - !ruby/object:Gem::Version
44
- version: '7.1'
44
+ version: '7.2'
45
45
  type: :runtime
46
46
  prerelease: false
47
47
  version_requirements: !ruby/object:Gem::Requirement
48
48
  requirements:
49
49
  - - ">="
50
50
  - !ruby/object:Gem::Version
51
- version: '5.2'
51
+ version: '6.1'
52
52
  - - "<"
53
53
  - !ruby/object:Gem::Version
54
- version: '7.1'
54
+ version: '7.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: appraisal
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -156,42 +156,84 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '1.25'
159
+ version: '1.52'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '1.25'
166
+ version: '1.52'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: rubocop-minitest
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 0.19.0
173
+ version: 0.35.0
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 0.19.0
180
+ version: 0.35.0
181
+ - !ruby/object:Gem::Dependency
182
+ name: rubocop-packaging
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: 0.5.2
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: 0.5.2
195
+ - !ruby/object:Gem::Dependency
196
+ name: rubocop-performance
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '1.18'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '1.18'
209
+ - !ruby/object:Gem::Dependency
210
+ name: rubocop-rake
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: 0.6.0
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: 0.6.0
181
223
  - !ruby/object:Gem::Dependency
182
224
  name: simplecov
183
225
  requirement: !ruby/object:Gem::Requirement
184
226
  requirements:
185
227
  - - "~>"
186
228
  - !ruby/object:Gem::Version
187
- version: 0.21.2
229
+ version: 0.22.0
188
230
  type: :development
189
231
  prerelease: false
190
232
  version_requirements: !ruby/object:Gem::Requirement
191
233
  requirements:
192
234
  - - "~>"
193
235
  - !ruby/object:Gem::Version
194
- version: 0.21.2
236
+ version: 0.22.0
195
237
  description: Check the home page for more in-depth information.
196
238
  email:
197
239
  - e@zzak.io
@@ -223,14 +265,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
223
265
  requirements:
224
266
  - - ">="
225
267
  - !ruby/object:Gem::Version
226
- version: 2.6.0
268
+ version: 3.0.0
227
269
  required_rubygems_version: !ruby/object:Gem::Requirement
228
270
  requirements:
229
271
  - - ">="
230
272
  - !ruby/object:Gem::Version
231
273
  version: '0'
232
274
  requirements: []
233
- rubygems_version: 3.3.7
275
+ rubygems_version: 3.5.10
234
276
  signing_key:
235
277
  specification_version: 4
236
278
  summary: Active Record plugin which allows you to hide and restore records without