effective_obfuscation 1.0.1 → 1.0.2

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
  SHA1:
3
- metadata.gz: 12942d2adf7b06425c87de3c2273cb8bbf3d6499
4
- data.tar.gz: df28a3f51bfbcaeafe634be70213ad211a648582
3
+ metadata.gz: d43a53ccd8e5d0645f62ed5b8df5d4da301434a3
4
+ data.tar.gz: 9d9c12550c41bd82d747a82efd6a4d86e0253640
5
5
  SHA512:
6
- metadata.gz: ed0fa0c196a802072d8a03b6423860e011181cd3a91a4229d2976a27a89d41fe0af2260e6fe7b47f80b0b03c1e7c251b53d153cbeda76c79b6724fe4ce39291b
7
- data.tar.gz: 150a7d028a7d0f6d927bbc97ebb52ede8c7043bbf71b2e781ab2036cc1414fb802dac1671b95c9af232a52abe940502b85bda8262c0a2ef393f62cc11612ab64
6
+ metadata.gz: 496fa9503d2ac0c4a517a3b4c3df291cf1e37139b26197b38941308d06ed7b7f9f5c4fbd97a43ee1588cfec1ec5fba268f6a8b7dd235e240ad02e10571aa8426
7
+ data.tar.gz: c652710e11f213c12c15d0b7782abb45662c96b4698ac4f767fa14b03b103984b937360a89669631b5d6659b46cdb32da1db34991314a903d9818ea40c85a824
@@ -74,11 +74,8 @@ module ActsAsObfuscated
74
74
  return original
75
75
  end
76
76
 
77
- if acts_as_obfuscated_opts[:format]
78
- obfuscated_id = original.to_s.delete('^0-9')
79
- else
80
- obfuscated_id = original.to_s
81
- end
77
+ # Remove any non-digit formatting characters, and only consider the first 10 digits
78
+ obfuscated_id = original.to_s.delete('^0-9').first(10)
82
79
 
83
80
  # 2147483647 is PostgreSQL's Integer Max Value. If we return a value higher than this, we get weird DB errors
84
81
  revealed = [EffectiveObfuscation.show(obfuscated_id, acts_as_obfuscated_opts[:spin]).to_i, 2147483647].min
@@ -1,3 +1,3 @@
1
1
  module EffectiveObfuscation
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.0.2'.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.0.1
4
+ version: 1.0.2
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: 2014-12-29 00:00:00.000000000 Z
11
+ date: 2015-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails