effective_obfuscation 1.3.3 → 1.4.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
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
|
|
@@ -152,7 +156,7 @@ module ActsAsObfuscated
|
|
152
156
|
next unless (d = deobfuscator(left))
|
153
157
|
args.first[left] = d.call(right)
|
154
158
|
end
|
155
|
-
elsif args.first.
|
159
|
+
elsif args.first.kind_of?(String) == false
|
156
160
|
deobfuscate_arel!(args.first)
|
157
161
|
end
|
158
162
|
|
@@ -186,5 +190,8 @@ module ActsAsObfuscated
|
|
186
190
|
self.class.obfuscate(self.id)
|
187
191
|
end
|
188
192
|
|
189
|
-
|
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
|
190
196
|
|
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
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
|
-
autorequire:
|
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
|
@@ -56,7 +56,7 @@ homepage: https://github.com/code-and-effect/effective_obfuscation
|
|
56
56
|
licenses:
|
57
57
|
- MIT
|
58
58
|
metadata: {}
|
59
|
-
post_install_message:
|
59
|
+
post_install_message:
|
60
60
|
rdoc_options: []
|
61
61
|
require_paths:
|
62
62
|
- lib
|
@@ -71,9 +71,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '0'
|
73
73
|
requirements: []
|
74
|
-
|
75
|
-
|
76
|
-
signing_key:
|
74
|
+
rubygems_version: 3.1.2
|
75
|
+
signing_key:
|
77
76
|
specification_version: 4
|
78
77
|
summary: Display unique 10-digit numbers instead of ActiveRecord IDs. Hides the ID
|
79
78
|
param so curious website visitors are unable to determine your resource count.
|