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 +4 -4
- data/CHANGELOG.md +27 -0
- data/README.md +5 -6
- data/lib/acts_as_paranoid/core.rb +4 -2
- data/lib/acts_as_paranoid/version.rb +1 -1
- data/lib/acts_as_paranoid.rb +13 -13
- metadata +60 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 992c8836d7fa518c06baf1be695fcad08a9f9332cbd25596041cdbcf7c61d525
|
4
|
+
data.tar.gz: 2deedb7d195a333cd869b60ada4fe9f91c3d68005a04470e5fb97115c3acb748
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
12
|
+
**This version targets Rails 6.1+ and Ruby 3.0+ only**
|
13
13
|
|
14
|
-
If you're working with Rails
|
15
|
-
please
|
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
|
-
|
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.
|
315
|
+
_reflections.each_value do |reflection|
|
314
316
|
yield reflection if reflection.belongs_to? && reflection.counter_cache_column
|
315
317
|
end
|
316
318
|
end
|
data/lib/acts_as_paranoid.rb
CHANGED
@@ -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
|
-
|
57
|
-
ActiveRecord
|
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
|
-
|
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
|
-
|
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.
|
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:
|
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: '
|
21
|
+
version: '6.1'
|
22
22
|
- - "<"
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version: '7.
|
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: '
|
31
|
+
version: '6.1'
|
32
32
|
- - "<"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '7.
|
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: '
|
41
|
+
version: '6.1'
|
42
42
|
- - "<"
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version: '7.
|
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: '
|
51
|
+
version: '6.1'
|
52
52
|
- - "<"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '7.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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:
|
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.
|
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
|