paranoia 2.6.1 → 2.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +26 -34
- data/CHANGELOG.md +11 -0
- data/lib/paranoia/version.rb +1 -1
- data/lib/paranoia.rb +6 -12
- data/paranoia.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f7493c138657c99cbb4eca5ed981c6bfac2400f18d34ad7fda9266ad672c39c
|
4
|
+
data.tar.gz: 4397c1ac47d8b67fb3db3a084bdaea2fec4d2ebe5c475c99b2914563e3011ae9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5acd851f9180575136c06b5e6c44db7a7b53462771d77d722790062ca7e4e2482e2938f35471b54d472f68c1d92b372334b3c269931d997bdd4562c5904ea800
|
7
|
+
data.tar.gz: 2efed9b375277b7c1d066499323fe23af8f1af9c139389c45f2688eeb231da1ab8584cd061ba49f66130af4751263eb52458d8d2f68ae1057765437cdc320811
|
data/.github/workflows/build.yml
CHANGED
@@ -15,40 +15,32 @@ jobs:
|
|
15
15
|
strategy:
|
16
16
|
fail-fast: false
|
17
17
|
matrix:
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
- 2
|
22
|
-
|
23
|
-
- 2
|
24
|
-
|
25
|
-
#
|
26
|
-
|
27
|
-
|
28
|
-
-
|
29
|
-
|
30
|
-
-
|
31
|
-
|
32
|
-
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
ruby: 2.
|
37
|
-
|
38
|
-
ruby: 2.5
|
39
|
-
|
40
|
-
ruby: 2.
|
41
|
-
|
42
|
-
|
43
|
-
#
|
44
|
-
- rails: '~> 5.1.0'
|
45
|
-
ruby: '3.0'
|
46
|
-
- rails: '~> 5.2.0'
|
47
|
-
ruby: '3.0'
|
48
|
-
- rails: '~> 5.1.0'
|
49
|
-
ruby: 3.1
|
50
|
-
- rails: '~> 5.2.0'
|
51
|
-
ruby: 3.1
|
18
|
+
rails: ["~> 7.1.0", "~> 7.0.0", "~> 6.1.0", "~> 6.0.0"]
|
19
|
+
ruby: ["3.2.2", "3.1.4", "3.0.6", "2.7.8"]
|
20
|
+
include:
|
21
|
+
- ruby: 3.2
|
22
|
+
rails: 'edge'
|
23
|
+
- ruby: 3.2
|
24
|
+
rails: '~> 7.1.0'
|
25
|
+
# single test failure with jruby
|
26
|
+
#- ruby: jruby-9.4
|
27
|
+
# rails: '~> 7.0.0'
|
28
|
+
- ruby: 2.6
|
29
|
+
rails: '~> 6.1.0'
|
30
|
+
- ruby: 2.6
|
31
|
+
rails: '~> 6.0.0'
|
32
|
+
- ruby: 2.6
|
33
|
+
rails: '~> 5.2.0'
|
34
|
+
- ruby: 2.6
|
35
|
+
rails: '~> 5.1.0'
|
36
|
+
- ruby: 2.5
|
37
|
+
rails: '~> 6.0.0'
|
38
|
+
- ruby: 2.5
|
39
|
+
rails: '~> 5.2.0'
|
40
|
+
- ruby: 2.5
|
41
|
+
rails: '~> 5.1.0'
|
42
|
+
#os: ubuntu-latest
|
43
|
+
#arch: x64
|
52
44
|
|
53
45
|
env:
|
54
46
|
RAILS: ${{ matrix.rails }}
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# paranoia Changelog
|
2
2
|
|
3
|
+
## 2.6.3
|
4
|
+
|
5
|
+
* [#548](https://github.com/rubysherpas/paranoia/pull/441) Add support for [Rails 7.1](https://github.com/rails/rails/releases/tag/v7.1.0) (#441)
|
6
|
+
|
7
|
+
[Indyarocks](https://github.com/indyarocks)
|
8
|
+
|
9
|
+
## 2.6.2
|
10
|
+
|
11
|
+
* [#441](https://github.com/rubysherpas/paranoia/pull/441) Recursive restore with has_many/one through assocs (#441)
|
12
|
+
[Emil Ong](https://github.com/emilong)
|
13
|
+
|
3
14
|
## 2.6.1
|
4
15
|
|
5
16
|
* [#535](https://github.com/rubysherpas/paranoia/pull/535) Allow to skip updating paranoia_destroy_attributes for records while really_destroy!
|
data/lib/paranoia/version.rb
CHANGED
data/lib/paranoia.rb
CHANGED
@@ -60,7 +60,7 @@ module Paranoia
|
|
60
60
|
def paranoia_destroy
|
61
61
|
with_transaction_returning_status do
|
62
62
|
result = run_callbacks(:destroy) do
|
63
|
-
@_disable_counter_cache =
|
63
|
+
@_disable_counter_cache = paranoia_destroyed?
|
64
64
|
result = paranoia_delete
|
65
65
|
next result unless result && ActiveRecord::VERSION::STRING >= '4.2'
|
66
66
|
each_counter_cached_associations do |association|
|
@@ -73,7 +73,7 @@ module Paranoia
|
|
73
73
|
@_disable_counter_cache = false
|
74
74
|
result
|
75
75
|
end
|
76
|
-
raise ActiveRecord::Rollback, "Not destroyed" unless
|
76
|
+
raise ActiveRecord::Rollback, "Not destroyed" unless paranoia_destroyed?
|
77
77
|
result
|
78
78
|
end || false
|
79
79
|
end
|
@@ -216,18 +216,12 @@ module Paranoia
|
|
216
216
|
end
|
217
217
|
|
218
218
|
if association_data.nil? && association.macro.to_s == "has_one"
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
if association.type
|
223
|
-
association_polymorphic_type = association.type
|
224
|
-
association_find_conditions = { association_polymorphic_type => self.class.name.to_s, association_foreign_key => self.id }
|
225
|
-
else
|
219
|
+
association_class = association.klass
|
220
|
+
if association_class.paranoid?
|
221
|
+
association_foreign_key = association.options[:through].present? ? association.klass.primary_key : association.foreign_key
|
226
222
|
association_find_conditions = { association_foreign_key => self.id }
|
227
|
-
|
223
|
+
association_find_conditions[association.type] = self.class.name if association.type
|
228
224
|
|
229
|
-
association_class = association_class_name.constantize
|
230
|
-
if association_class.paranoid?
|
231
225
|
association_class.only_deleted.where(association_find_conditions).first
|
232
226
|
.try!(:restore, recursive: true, :recovery_window_range => recovery_window_range)
|
233
227
|
end
|
data/paranoia.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.license = 'MIT'
|
12
12
|
s.summary = "Paranoia is a re-implementation of acts_as_paranoid for Rails 3, 4, and 5, using much, much, much less code."
|
13
13
|
s.description = <<-DSC
|
14
|
-
Paranoia is a re-implementation of acts_as_paranoid for Rails
|
14
|
+
Paranoia is a re-implementation of acts_as_paranoid for Rails 5, 6, and 7,
|
15
15
|
using much, much, much less code. You would use either plugin / gem if you
|
16
16
|
wished that when you called destroy on an Active Record object that it
|
17
17
|
didn't actually destroy it, but just "hid" the record. Paranoia does this
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
|
25
25
|
s.required_ruby_version = '>= 2.5'
|
26
26
|
|
27
|
-
s.add_dependency 'activerecord', '>= 5.1', '< 7.
|
27
|
+
s.add_dependency 'activerecord', '>= 5.1', '< 7.2'
|
28
28
|
|
29
29
|
s.add_development_dependency "bundler", ">= 1.0.0"
|
30
30
|
s.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paranoia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- radarlistener@gmail.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '5.1'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '7.
|
22
|
+
version: '7.2'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '5.1'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '7.
|
32
|
+
version: '7.2'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
61
|
description: |2
|
62
|
-
Paranoia is a re-implementation of acts_as_paranoid for Rails
|
62
|
+
Paranoia is a re-implementation of acts_as_paranoid for Rails 5, 6, and 7,
|
63
63
|
using much, much, much less code. You would use either plugin / gem if you
|
64
64
|
wished that when you called destroy on an Active Record object that it
|
65
65
|
didn't actually destroy it, but just "hid" the record. Paranoia does this
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
- !ruby/object:Gem::Version
|
107
107
|
version: 1.3.6
|
108
108
|
requirements: []
|
109
|
-
rubygems_version: 3.4.
|
109
|
+
rubygems_version: 3.4.18
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: Paranoia is a re-implementation of acts_as_paranoid for Rails 3, 4, and 5,
|