effective_obfuscation 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: 9af4e62c534fedb726efd7d7c11dfb75e73260d44f8f2bdd66c99cc49927dac2
|
4
|
+
data.tar.gz: 8171f178c2525e22a66b0b0a3d27156d923912ef020e5cfb72681056403ec3a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 791ebc00d59d967e7b0c30269d6baf5dbee04937f2b731b53f4f71e43a0f4d8f168c35637bc628e8fb565cae0b080fae0d33d71d738296487cc62fd83d25de81
|
7
|
+
data.tar.gz: ba216d31e8ccb4ab65c36b5974f54d55839092970987bd0afbc281fed26a5fbdf8f18f56167a187087f0724c6e90a33e3d3e8a58e1133dad3e55bbfa81dd07ae
|
@@ -57,6 +57,10 @@ module ActsAsObfuscated
|
|
57
57
|
end
|
58
58
|
|
59
59
|
module ClassMethods
|
60
|
+
def acts_as_obfuscated?
|
61
|
+
true
|
62
|
+
end
|
63
|
+
|
60
64
|
def obfuscate(original)
|
61
65
|
obfuscated = EffectiveObfuscation.hide(original, acts_as_obfuscated_opts[:spin])
|
62
66
|
|
@@ -186,4 +190,8 @@ module ActsAsObfuscated
|
|
186
190
|
self.class.obfuscate(self.id)
|
187
191
|
end
|
188
192
|
|
193
|
+
def to_global_id(**params)
|
194
|
+
GlobalID.new(URI::GID.build(app: Rails.application.config.global_id.app, model_name: model_name, model_id: to_param, params: params))
|
195
|
+
end
|
196
|
+
|
189
197
|
end
|
@@ -4,8 +4,10 @@ module EffectiveObfuscation
|
|
4
4
|
|
5
5
|
# Include acts_as_addressable concern and allow any ActiveRecord object to call it
|
6
6
|
initializer 'effective_obfuscation.active_record' do |app|
|
7
|
-
|
8
|
-
|
7
|
+
app.config.to_prepare do
|
8
|
+
ActiveSupport.on_load :active_record do
|
9
|
+
ActiveRecord::Base.extend(ActsAsObfuscated::ActiveRecord)
|
10
|
+
end
|
9
11
|
end
|
10
12
|
end
|
11
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_obfuscation
|
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
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|