effective_obfuscation 1.1.1 → 1.1.2
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
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9993a73260698ae5551f4f53fa16009e7cefb1ee
|
4
|
+
data.tar.gz: 8251eb929a814ce1fa0b166ffd66404ac77f55e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e3abfc550594ef29c82d63ff83c0042fdae23e5c659c5fed8cd846242d410b8dd9212acf429fbc4d670d27fb5c1540837fe76790959c3f0a616afea55371f5b
|
7
|
+
data.tar.gz: 1f81daeeb4da26833dc9d40aad0034ae7423395079573464e69007f407a983a3e7a7575d656a2954e7bf3387018fb4c1d3a06885b0dcd97f007285c2d1585bd6
|
@@ -47,7 +47,10 @@ module ActsAsObfuscated
|
|
47
47
|
|
48
48
|
# Work with Ransack if available
|
49
49
|
if self.respond_to?(:ransacker)
|
50
|
-
ransacker :id, :formatter => Proc.new { |
|
50
|
+
ransacker :id, :formatter => Proc.new { |original|
|
51
|
+
obfuscated_id = original.to_s.delete('^0-9').first(10)
|
52
|
+
obfuscated_id.length == 10 ? deobfuscate(original) : 0
|
53
|
+
} { |parent| parent.table[:id] }
|
51
54
|
end
|
52
55
|
|
53
56
|
if ::ActiveRecord::VERSION::MAJOR == 4 && ::ActiveRecord::VERSION::MINOR == 2
|
@@ -98,6 +101,7 @@ module ActsAsObfuscated
|
|
98
101
|
reflect_on_all_associations(:belongs_to).each do |reflection|
|
99
102
|
if reflection.klass.respond_to?(:deobfuscate)
|
100
103
|
deobfuscators[reflection.foreign_key] = Proc.new { |right| reflection.klass.deobfuscate(right) }
|
104
|
+
# Should override the foreign_object_id= method and deobfuscate it too
|
101
105
|
end
|
102
106
|
end
|
103
107
|
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.1.
|
4
|
+
version: 1.1.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:
|
11
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -47,13 +47,13 @@ executables: []
|
|
47
47
|
extensions: []
|
48
48
|
extra_rdoc_files: []
|
49
49
|
files:
|
50
|
+
- MIT-LICENSE
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
50
53
|
- app/models/concerns/acts_as_obfuscated.rb
|
54
|
+
- lib/effective_obfuscation.rb
|
51
55
|
- lib/effective_obfuscation/engine.rb
|
52
56
|
- lib/effective_obfuscation/version.rb
|
53
|
-
- lib/effective_obfuscation.rb
|
54
|
-
- MIT-LICENSE
|
55
|
-
- Rakefile
|
56
|
-
- README.md
|
57
57
|
- spec/effective_obfuscation_spec.rb
|
58
58
|
- spec/spec_helper.rb
|
59
59
|
homepage: https://github.com/code-and-effect/effective_obfuscation
|
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
76
|
version: '0'
|
77
77
|
requirements: []
|
78
78
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.
|
79
|
+
rubygems_version: 2.4.6
|
80
80
|
signing_key:
|
81
81
|
specification_version: 4
|
82
82
|
summary: Display unique 10-digit numbers instead of ActiveRecord IDs. Hides the ID
|