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: 8c6e7de8d7952b1908c410cb22eac9d30fcde46d61cba65afa8261c684d6386e
4
- data.tar.gz: 25556589bebd12bd7c1986ee5ce4d5e46afc359be6911e2b331252bebcb19315
3
+ metadata.gz: 9af4e62c534fedb726efd7d7c11dfb75e73260d44f8f2bdd66c99cc49927dac2
4
+ data.tar.gz: 8171f178c2525e22a66b0b0a3d27156d923912ef020e5cfb72681056403ec3a7
5
5
  SHA512:
6
- metadata.gz: 33293e400fab0e47d49ec08d3b53e5b7a47029689ecc9a5dcfeb52876259424abad7abf99f4c8b9a715e999c69a969a502ac221b81f99159cb952a8bd7233332
7
- data.tar.gz: 3d3815196f2a571b47e267bb8455b21fe775fb944d1226efa03419f131c6545802af3cf4c57e003abc8f7a091e1224f3b62737a9fdf6b5e9a649ad1e35889eed
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
- 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.4.0'.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.4.0
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: 2021-06-07 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