crypt_keeper 0.18.2 → 0.18.3
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
- data/gemfiles/activerecord_3_1.gemfile.lock +1 -1
- data/gemfiles/activerecord_3_2.gemfile.lock +1 -1
- data/gemfiles/activerecord_4_0.gemfile.lock +1 -1
- data/gemfiles/activerecord_4_1.gemfile.lock +1 -1
- data/lib/crypt_keeper/model.rb +3 -1
- data/lib/crypt_keeper/version.rb +1 -1
- data/spec/model_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 433790fab8e0ac4f0919d46b0871cca2c57b6188
|
|
4
|
+
data.tar.gz: 827c5011c4d43262b8c3617b3ab6f390787db0ac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 116c69a7fa81968612b2e4d6c50c9fabc4a90b3494e01aaa8285714a3eaf08c512c8b9899b2c74a230a7765a10c54216aaf2854c243a8ec3452ff92bacba1fd9
|
|
7
|
+
data.tar.gz: c9201556884c792c58fa9e2d56fa27b79eafc9b0972490e7e3fac290fb58a2135660e9638ba35cc156466bcae4fa490a89799bc365dbc9bfd700641fe0a0bca0
|
data/lib/crypt_keeper/model.rb
CHANGED
|
@@ -27,7 +27,9 @@ module CryptKeeper
|
|
|
27
27
|
# Private: Force string encodings if the option is set
|
|
28
28
|
def force_encodings_on_fields
|
|
29
29
|
crypt_keeper_fields.each do |field|
|
|
30
|
-
|
|
30
|
+
if attributes.has_key?(field.to_s) && send(field).respond_to?(:force_encoding)
|
|
31
|
+
send(field).force_encoding(crypt_keeper_encoding)
|
|
32
|
+
end
|
|
31
33
|
end
|
|
32
34
|
end
|
|
33
35
|
|
data/lib/crypt_keeper/version.rb
CHANGED
data/spec/model_spec.rb
CHANGED
|
@@ -123,5 +123,14 @@ module CryptKeeper
|
|
|
123
123
|
expect { subject.first(5).map(&:storage) }.not_to raise_error
|
|
124
124
|
end
|
|
125
125
|
end
|
|
126
|
+
|
|
127
|
+
context "Missing Attributes" do
|
|
128
|
+
subject { create_encrypted_model :storage, key: 'tool', salt: 'salt', encryptor: :aes_new, encoding: 'utf-8' }
|
|
129
|
+
|
|
130
|
+
it "doesn't attempt decryption of missing attributes" do
|
|
131
|
+
subject.create!(storage: 'blah')
|
|
132
|
+
expect { subject.select(:id).first }.to_not raise_error
|
|
133
|
+
end
|
|
134
|
+
end
|
|
126
135
|
end
|
|
127
136
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: crypt_keeper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.18.
|
|
4
|
+
version: 0.18.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Justin Mazzi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-10-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|