attr_encrypted 3.0.0 → 3.0.1
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +3 -0
- data/checksum/attr_encrypted-3.0.0.gem.sha256 +1 -0
- data/checksum/attr_encrypted-3.0.0.gem.sha512 +1 -0
- data/lib/attr_encrypted/adapters/active_record.rb +4 -2
- data/lib/attr_encrypted/version.rb +1 -1
- data/test/active_record_test.rb +6 -0
- metadata +4 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac79c02884af5b1ee935a1f50d238f17d72346ff
|
4
|
+
data.tar.gz: cfdf773acde0d0b7c752f972064237395ba57071
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42303b9fe3e46f0ce59c52a6cdcbaf73a3f8b6457f30ab7cbc62c765e9decb2c6b6559fc36135ff81867f5497c7952a1f84d14b1ef70020226dac12bc0f4d68e
|
7
|
+
data.tar.gz: 183ebc248cb0af6a621aa7edd471532634437a6367cc503810cd9409a94a04b60d6c7a186945bb533a3bf16f1e88c39f0e01c3da5e8afd00f95e5ea961b346d1
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# attr_encrypted #
|
2
2
|
|
3
|
+
## 3.0.1 ##
|
4
|
+
* Fixed: attr_was method no longer calls undefined methods. (@saghaulor)
|
5
|
+
|
3
6
|
## 3.0.0 ##
|
4
7
|
* Changed: Updated gemspec to use Encryptor v3.0.0. (@saghaulor)
|
5
8
|
* Changed: Updated README with instructions related to moving from v2.0.0 to v3.0.0. (@saghaulor)
|
@@ -0,0 +1 @@
|
|
1
|
+
845fc3cb09a19c3ac76192aba443788f92c880744617bca99b16fd31ce843e07
|
@@ -0,0 +1 @@
|
|
1
|
+
81a065442258cc3702aab62c7b2307a48ed3e0deb803600d11a7480cce0db7c43fd9929acd2755081042f8989236553fd694b6cb62776bbfc53f9165a22cbca1
|
@@ -59,8 +59,10 @@ if defined?(ActiveRecord::Base)
|
|
59
59
|
end
|
60
60
|
|
61
61
|
define_method("#{attr}_was") do
|
62
|
-
|
63
|
-
|
62
|
+
attr_was_options = { operation: :decrypting }
|
63
|
+
attr_was_options[:iv]= send("#{options[:attribute]}_iv_was") if respond_to?("#{options[:attribute]}_iv_was")
|
64
|
+
attr_was_options[:salt]= send("#{options[:attribute]}_salt_was") if respond_to?("#{options[:attribute]}_salt_was")
|
65
|
+
encrypted_attributes[attr].merge!(attr_was_options)
|
64
66
|
evaluated_options = evaluated_attr_encrypted_options_for(attr)
|
65
67
|
[:iv, :salt, :operation].each { |key| encrypted_attributes[attr].delete(key) }
|
66
68
|
self.class.decrypt(attr, send("#{options[:attribute]}_was"), evaluated_options)
|
data/test/active_record_test.rb
CHANGED
@@ -192,6 +192,12 @@ class ActiveRecordTest < Minitest::Test
|
|
192
192
|
assert_equal original_email, person.email_was
|
193
193
|
person.email = 'test2@example.com'
|
194
194
|
assert_equal original_email, person.email_was
|
195
|
+
old_pm_name = "Winston Churchill"
|
196
|
+
pm = PrimeMinister.create!(name: old_pm_name)
|
197
|
+
assert_equal old_pm_name, pm.name_was
|
198
|
+
old_zipcode = "90210"
|
199
|
+
address = Address.create!(zipcode: old_zipcode, mode: "single_iv_and_salt")
|
200
|
+
assert_equal old_zipcode, address.zipcode_was
|
195
201
|
end
|
196
202
|
|
197
203
|
if ::ActiveRecord::VERSION::STRING > "4.0"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attr_encrypted
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Huber
|
@@ -33,7 +33,7 @@ cert_chain:
|
|
33
33
|
ZjeLmnSDiwL6doiP5IiwALH/dcHU67ck3NGf6XyqNwQrrmtPY0mv1WVVL4Uh+vYE
|
34
34
|
kHoFzE2no0BfBg78Re8fY69P5yES5ncC
|
35
35
|
-----END CERTIFICATE-----
|
36
|
-
date: 2016-
|
36
|
+
date: 2016-04-02 00:00:00.000000000 Z
|
37
37
|
dependencies:
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: encryptor
|
@@ -222,6 +222,8 @@ files:
|
|
222
222
|
- Rakefile
|
223
223
|
- attr_encrypted.gemspec
|
224
224
|
- certs/saghaulor.pem
|
225
|
+
- checksum/attr_encrypted-3.0.0.gem.sha256
|
226
|
+
- checksum/attr_encrypted-3.0.0.gem.sha512
|
225
227
|
- lib/attr_encrypted.rb
|
226
228
|
- lib/attr_encrypted/adapters/active_record.rb
|
227
229
|
- lib/attr_encrypted/adapters/data_mapper.rb
|
metadata.gz.sig
CHANGED
Binary file
|