effective_obfuscation 1.3.3 → 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
- SHA1:
3
- metadata.gz: 6c5314329878e18d055b1f2192cf5c93b4460cca
4
- data.tar.gz: 8746112640aca43f91b9472dfddbc81233f318b1
2
+ SHA256:
3
+ metadata.gz: 9af4e62c534fedb726efd7d7c11dfb75e73260d44f8f2bdd66c99cc49927dac2
4
+ data.tar.gz: 8171f178c2525e22a66b0b0a3d27156d923912ef020e5cfb72681056403ec3a7
5
5
  SHA512:
6
- metadata.gz: eb3c20d75131f27daf792d7a4916b13c88c38a0a32d0d382c3b459b1f0d287091610fdb605f04816df6257a205056c798f6aec775b55d3745f1919994a0724e9
7
- data.tar.gz: 7f75d8a43b9b2404ff697e4d439f194142631f2d8f7538af25e84822d33b1eedf85cd523369c945bbf29e0d47c1c0aaf4381fd5ad5a9924b09410b889ece28c0
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.class.parent == Arel::Nodes
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
- end
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
- ActiveSupport.on_load :active_record do
8
- ActiveRecord::Base.extend(ActsAsObfuscated::ActiveRecord)
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
@@ -1,3 +1,3 @@
1
1
  module EffectiveObfuscation
2
- VERSION = '1.3.3'.freeze
2
+ VERSION = '1.4.1'.freeze
3
3
  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.3.3
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: 2018-02-21 00:00:00.000000000 Z
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
- rubyforge_project:
75
- rubygems_version: 2.4.5.1
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.