gdpr_admin 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99489f549c8f701322c68c19a73dad4796af585f7b981ac8680590b14e2b299e
|
4
|
+
data.tar.gz: c2918882ca853ded91dc6ecd8aa52ae95dd6c2a9cac99d6c829917693d7e96e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29c763ef8b44f45c56c63c4da8fc8b275dd2a2ce3f6bdb1c8808015543343bcafc1599450d74c2d54be74a8c2020c24649fd31f94d2f0188e38fcc19bc8b6637
|
7
|
+
data.tar.gz: b68927faf70d507c7992f7a64fc2a7eab37034533ebc492d93490179e6e0f276ece51ef2855b06ba938ef03fe974230a2770145a7a263a0fcf2baf181c588b19
|
@@ -43,14 +43,18 @@ module GdprAdmin
|
|
43
43
|
def process
|
44
44
|
GdprAdmin.config.tenant_adapter.with_tenant(request.tenant) do
|
45
45
|
run_preprocessors
|
46
|
-
scope
|
47
|
-
process_record(record)
|
48
|
-
end
|
46
|
+
process_scope(scope)
|
49
47
|
rescue SkipDataPolicyError
|
50
48
|
nil
|
51
49
|
end
|
52
50
|
end
|
53
51
|
|
52
|
+
def process_scope(scope)
|
53
|
+
scope.find_each do |record|
|
54
|
+
process_record(record)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
54
58
|
protected
|
55
59
|
|
56
60
|
attr_reader :request
|
@@ -80,9 +84,13 @@ module GdprAdmin
|
|
80
84
|
def call_hook(hook, value = nil)
|
81
85
|
hook = method(hook) unless hook.respond_to?(:call)
|
82
86
|
|
83
|
-
arity = hook
|
87
|
+
arity = arity_of(hook)
|
84
88
|
args = [value].take(arity).reverse
|
85
89
|
instance_exec(*args, &hook)
|
86
90
|
end
|
91
|
+
|
92
|
+
def arity_of(method_or_proc)
|
93
|
+
defined?(T::Utils.arity) ? T::Utils.arity(method_or_proc) : method_or_proc.arity
|
94
|
+
end
|
87
95
|
end
|
88
96
|
end
|
@@ -10,6 +10,16 @@ module GdprAdmin
|
|
10
10
|
def skip_record!
|
11
11
|
raise SkipRecordError
|
12
12
|
end
|
13
|
+
|
14
|
+
def model_data_policy_class(model)
|
15
|
+
model = model.constantize if model.is_a?(String)
|
16
|
+
return model.data_policy_class if model.respond_to?(:data_policy_class)
|
17
|
+
|
18
|
+
prefix = model.data_policy_prefix if model.respond_to?(:data_policy_prefix)
|
19
|
+
"#{prefix}#{model}DataPolicy".constantize
|
20
|
+
rescue NameError
|
21
|
+
nil
|
22
|
+
end
|
13
23
|
end
|
14
24
|
end
|
15
25
|
end
|
@@ -32,13 +32,7 @@ module GdprAdmin
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def infer_data_policy_class(version)
|
35
|
-
|
36
|
-
return model.data_policy_class if model.respond_to?(:data_policy_class)
|
37
|
-
|
38
|
-
prefix = model.data_policy_prefix if model.respond_to?(:data_policy_prefix)
|
39
|
-
"#{prefix}#{version.item_type}DataPolicy".constantize
|
40
|
-
rescue NameError
|
41
|
-
nil
|
35
|
+
model_data_policy_class(version.item_type)
|
42
36
|
end
|
43
37
|
end
|
44
38
|
end
|
data/lib/gdpr_admin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gdpr_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colex
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03
|
11
|
+
date: 2023-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|