effective_obfuscation 1.0.2 → 1.0.3

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: d43a53ccd8e5d0645f62ed5b8df5d4da301434a3
4
- data.tar.gz: 9d9c12550c41bd82d747a82efd6a4d86e0253640
3
+ metadata.gz: 965b2c5a89156eb09250013de2ed06c890ec2e2b
4
+ data.tar.gz: 18cac14cd25267a9cc399078a137ba691e8cf519
5
5
  SHA512:
6
- metadata.gz: 496fa9503d2ac0c4a517a3b4c3df291cf1e37139b26197b38941308d06ed7b7f9f5c4fbd97a43ee1588cfec1ec5fba268f6a8b7dd235e240ad02e10571aa8426
7
- data.tar.gz: c652710e11f213c12c15d0b7782abb45662c96b4698ac4f767fa14b03b103984b937360a89669631b5d6659b46cdb32da1db34991314a903d9818ea40c85a824
6
+ metadata.gz: 9f06d20fd272e2fd8173091192165736e819b4114a42a49859b6751e249cbbfae44bad954353950a6ea1cccaa9dbd53c0a74be23ed53007ee7e6b8ef9fd2d1a4
7
+ data.tar.gz: 3e1b7c89aeef8f178556bda29f45ada087839a70af422ca6946fba813fd68d5fd95649afd6b9c929a86fc56b5e89f625cbc8751e891872dc59fe09817273b1b8
@@ -49,6 +49,10 @@ module ActsAsObfuscated
49
49
  if self.respond_to?(:ransacker)
50
50
  ransacker :id, :formatter => Proc.new { |v| deobfuscate(v) } { |parent| parent.table[:id] }
51
51
  end
52
+
53
+ if ::ActiveRecord::VERSION::MAJOR == 4 && ::ActiveRecord::VERSION::MINOR == 2
54
+ extend FinderMethods
55
+ end
52
56
  end
53
57
 
54
58
  module ClassMethods
@@ -112,6 +116,8 @@ module ActsAsObfuscated
112
116
 
113
117
  module FinderMethods
114
118
  def find(*args)
119
+ return find_by_id(args.first) if @_effective_obfuscation_reloading
120
+
115
121
  super(deobfuscate(args.first, false))
116
122
  end
117
123
 
@@ -163,6 +169,13 @@ module ActsAsObfuscated
163
169
  end
164
170
  end
165
171
 
172
+ def reload(options = nil)
173
+ self.class.instance_variable_set(:@_effective_obfuscation_reloading, true)
174
+ retval = super
175
+ self.class.instance_variable_set(:@_effective_obfuscation_reloading, nil)
176
+ retval
177
+ end
178
+
166
179
  def to_param
167
180
  self.class.obfuscate(self.id)
168
181
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveObfuscation
2
- VERSION = '1.0.2'.freeze
2
+ VERSION = '1.0.3'.freeze
3
3
  end
@@ -1,6 +1,5 @@
1
- require "effective_obfuscation/engine"
2
- require "effective_obfuscation/version"
3
1
  require 'scatter_swap'
2
+ require "effective_obfuscation/engine"
4
3
 
5
4
  module EffectiveObfuscation
6
5
  def self.hide(id, spin)
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_obfuscation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
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: 2015-09-30 00:00:00.000000000 Z
11
+ date: 2015-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: scatter_swap
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.0.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.0.3
41
41
  description: Display unique 10-digit numbers instead of ActiveRecord IDs. Hides the
@@ -47,13 +47,13 @@ executables: []
47
47
  extensions: []
48
48
  extra_rdoc_files: []
49
49
  files:
50
- - MIT-LICENSE
51
- - README.md
52
- - Rakefile
53
50
  - app/models/concerns/acts_as_obfuscated.rb
54
- - lib/effective_obfuscation.rb
55
51
  - lib/effective_obfuscation/engine.rb
56
52
  - 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
@@ -66,17 +66,17 @@ require_paths:
66
66
  - lib
67
67
  required_ruby_version: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - ">="
69
+ - - '>='
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ">="
74
+ - - '>='
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  requirements: []
78
78
  rubyforge_project:
79
- rubygems_version: 2.4.3
79
+ rubygems_version: 2.0.14
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: Display unique 10-digit numbers instead of ActiveRecord IDs. Hides the ID