acts_as_paranoid 0.6.3 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +69 -16
- data/README.md +130 -68
- data/lib/acts_as_paranoid.rb +31 -30
- data/lib/acts_as_paranoid/associations.rb +21 -17
- data/lib/acts_as_paranoid/core.rb +87 -77
- data/lib/acts_as_paranoid/relation.rb +2 -0
- data/lib/acts_as_paranoid/validations.rb +8 -74
- data/lib/acts_as_paranoid/version.rb +3 -1
- data/test/test_associations.rb +119 -43
- data/test/test_core.rb +90 -66
- data/test/test_default_scopes.rb +7 -5
- data/test/test_helper.rb +87 -65
- data/test/test_inheritance.rb +3 -1
- data/test/test_relations.rb +18 -10
- data/test/test_validations.rb +9 -7
- metadata +57 -26
- data/lib/acts_as_paranoid/preloader_association.rb +0 -16
- data/test/test_preloader_association.rb +0 -27
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.7.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: 2020-
|
13
|
+
date: 2020-08-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
21
|
+
version: '5.2'
|
22
22
|
- - "<"
|
23
23
|
- !ruby/object:Gem::Version
|
24
24
|
version: '7.0'
|
@@ -28,7 +28,7 @@ dependencies:
|
|
28
28
|
requirements:
|
29
29
|
- - ">="
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
version: '
|
31
|
+
version: '5.2'
|
32
32
|
- - "<"
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '7.0'
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
requirements:
|
39
39
|
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
41
|
+
version: '5.2'
|
42
42
|
- - "<"
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '7.0'
|
@@ -48,7 +48,7 @@ dependencies:
|
|
48
48
|
requirements:
|
49
49
|
- - ">="
|
50
50
|
- !ruby/object:Gem::Version
|
51
|
-
version: '
|
51
|
+
version: '5.2'
|
52
52
|
- - "<"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '7.0'
|
@@ -73,7 +73,27 @@ dependencies:
|
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '3.0'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
76
|
+
name: minitest
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '4.0'
|
82
|
+
- - "<="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '6.0'
|
85
|
+
type: :development
|
86
|
+
prerelease: false
|
87
|
+
version_requirements: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '4.0'
|
92
|
+
- - "<="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '6.0'
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: pry
|
77
97
|
requirement: !ruby/object:Gem::Requirement
|
78
98
|
requirements:
|
79
99
|
- - ">="
|
@@ -87,7 +107,7 @@ dependencies:
|
|
87
107
|
- !ruby/object:Gem::Version
|
88
108
|
version: '0'
|
89
109
|
- !ruby/object:Gem::Dependency
|
90
|
-
name:
|
110
|
+
name: rake
|
91
111
|
requirement: !ruby/object:Gem::Requirement
|
92
112
|
requirements:
|
93
113
|
- - ">="
|
@@ -101,39 +121,53 @@ dependencies:
|
|
101
121
|
- !ruby/object:Gem::Version
|
102
122
|
version: '0'
|
103
123
|
- !ruby/object:Gem::Dependency
|
104
|
-
name:
|
124
|
+
name: rdoc
|
105
125
|
requirement: !ruby/object:Gem::Requirement
|
106
126
|
requirements:
|
107
127
|
- - ">="
|
108
128
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
110
|
-
- - "<="
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
version: '6.0'
|
129
|
+
version: '0'
|
113
130
|
type: :development
|
114
131
|
prerelease: false
|
115
132
|
version_requirements: !ruby/object:Gem::Requirement
|
116
133
|
requirements:
|
117
134
|
- - ">="
|
118
135
|
- !ruby/object:Gem::Version
|
119
|
-
version: '
|
120
|
-
|
136
|
+
version: '0'
|
137
|
+
- !ruby/object:Gem::Dependency
|
138
|
+
name: rubocop
|
139
|
+
requirement: !ruby/object:Gem::Requirement
|
140
|
+
requirements:
|
141
|
+
- - "~>"
|
121
142
|
- !ruby/object:Gem::Version
|
122
|
-
version:
|
143
|
+
version: 0.89.1
|
144
|
+
type: :development
|
145
|
+
prerelease: false
|
146
|
+
version_requirements: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - "~>"
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: 0.89.1
|
123
151
|
- !ruby/object:Gem::Dependency
|
124
|
-
name:
|
152
|
+
name: simplecov
|
125
153
|
requirement: !ruby/object:Gem::Requirement
|
126
154
|
requirements:
|
127
155
|
- - ">="
|
128
156
|
- !ruby/object:Gem::Version
|
129
|
-
version:
|
157
|
+
version: 0.18.1
|
158
|
+
- - "<"
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: 0.20.0
|
130
161
|
type: :development
|
131
162
|
prerelease: false
|
132
163
|
version_requirements: !ruby/object:Gem::Requirement
|
133
164
|
requirements:
|
134
165
|
- - ">="
|
135
166
|
- !ruby/object:Gem::Version
|
136
|
-
version:
|
167
|
+
version: 0.18.1
|
168
|
+
- - "<"
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: 0.20.0
|
137
171
|
description: Check the home page for more in-depth information.
|
138
172
|
email:
|
139
173
|
- e@zzak.io
|
@@ -147,7 +181,6 @@ files:
|
|
147
181
|
- lib/acts_as_paranoid.rb
|
148
182
|
- lib/acts_as_paranoid/associations.rb
|
149
183
|
- lib/acts_as_paranoid/core.rb
|
150
|
-
- lib/acts_as_paranoid/preloader_association.rb
|
151
184
|
- lib/acts_as_paranoid/relation.rb
|
152
185
|
- lib/acts_as_paranoid/validations.rb
|
153
186
|
- lib/acts_as_paranoid/version.rb
|
@@ -156,7 +189,6 @@ files:
|
|
156
189
|
- test/test_default_scopes.rb
|
157
190
|
- test/test_helper.rb
|
158
191
|
- test/test_inheritance.rb
|
159
|
-
- test/test_preloader_association.rb
|
160
192
|
- test/test_relations.rb
|
161
193
|
- test/test_validations.rb
|
162
194
|
homepage: https://github.com/ActsAsParanoid/acts_as_paranoid
|
@@ -171,7 +203,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
171
203
|
requirements:
|
172
204
|
- - ">="
|
173
205
|
- !ruby/object:Gem::Version
|
174
|
-
version:
|
206
|
+
version: 2.4.0
|
175
207
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
208
|
requirements:
|
177
209
|
- - ">="
|
@@ -184,11 +216,10 @@ specification_version: 4
|
|
184
216
|
summary: Active Record plugin which allows you to hide and restore records without
|
185
217
|
actually deleting them.
|
186
218
|
test_files:
|
187
|
-
- test/test_validations.rb
|
188
219
|
- test/test_relations.rb
|
189
220
|
- test/test_inheritance.rb
|
221
|
+
- test/test_core.rb
|
190
222
|
- test/test_default_scopes.rb
|
191
|
-
- test/test_associations.rb
|
192
223
|
- test/test_helper.rb
|
193
|
-
- test/
|
194
|
-
- test/
|
224
|
+
- test/test_validations.rb
|
225
|
+
- test/test_associations.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module ActsAsParanoid
|
2
|
-
module PreloaderAssociation
|
3
|
-
def self.included(base)
|
4
|
-
base.class_eval do
|
5
|
-
def build_scope_with_deleted
|
6
|
-
scope = build_scope_without_deleted
|
7
|
-
scope = scope.with_deleted if reflection.options[:with_deleted] && klass.respond_to?(:with_deleted)
|
8
|
-
scope
|
9
|
-
end
|
10
|
-
|
11
|
-
alias_method :build_scope_without_deleted, :build_scope
|
12
|
-
alias_method :build_scope, :build_scope_with_deleted
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class PreloaderAssociationTest < ParanoidBaseTest
|
4
|
-
def test_includes_with_deleted
|
5
|
-
paranoid_time = ParanoidTime.first
|
6
|
-
paranoid_has_many_dependant = paranoid_time.paranoid_has_many_dependants.create(:name => 'dependant!')
|
7
|
-
|
8
|
-
paranoid_time.destroy
|
9
|
-
|
10
|
-
ParanoidHasManyDependant.with_deleted.includes(:paranoid_time_with_deleted).each do |hasmany|
|
11
|
-
assert_not_nil hasmany.paranoid_time_with_deleted
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_includes_with_deleted_with_polymorphic_parent
|
16
|
-
not_paranoid_parent = NotParanoidHasManyAsParent.create(name: 'not paranoid parent')
|
17
|
-
paranoid_parent = ParanoidHasManyAsParent.create(name: 'paranoid parent')
|
18
|
-
ParanoidBelongsToPolymorphic.create(:name => 'belongs_to', :parent => not_paranoid_parent)
|
19
|
-
ParanoidBelongsToPolymorphic.create(:name => 'belongs_to', :parent => paranoid_parent)
|
20
|
-
|
21
|
-
paranoid_parent.destroy
|
22
|
-
|
23
|
-
ParanoidBelongsToPolymorphic.with_deleted.includes(:parent).each do |hasmany|
|
24
|
-
assert_not_nil hasmany.parent
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|