crypt_keeper 0.18.2 → 0.18.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: 7f892ea12e8ebe78efc372c995b6046043839599
4
- data.tar.gz: 5c058382eed934967e33b4cc4f68644712b4a4d9
3
+ metadata.gz: 433790fab8e0ac4f0919d46b0871cca2c57b6188
4
+ data.tar.gz: 827c5011c4d43262b8c3617b3ab6f390787db0ac
5
5
  SHA512:
6
- metadata.gz: 708f2a385bd0bab815a376dfc4252bf5791a76d53c29e1affdf633a046ebcc4811a27610175d40f3cb6bed1062cee33b1ebe22777298a217befbee39de6938c8
7
- data.tar.gz: b6585ed554225f21b49cdc9384bd2a83e9601368430bd44282af3ae31b0e07c452fa3a9210f699204fb2dc3e35d4a1d9e35d8695f73e3ff92bfa0d3d2f147a29
6
+ metadata.gz: 116c69a7fa81968612b2e4d6c50c9fabc4a90b3494e01aaa8285714a3eaf08c512c8b9899b2c74a230a7765a10c54216aaf2854c243a8ec3452ff92bacba1fd9
7
+ data.tar.gz: c9201556884c792c58fa9e2d56fa27b79eafc9b0972490e7e3fac290fb58a2135660e9638ba35cc156466bcae4fa490a89799bc365dbc9bfd700641fe0a0bca0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- crypt_keeper (0.18.1)
4
+ crypt_keeper (0.18.2)
5
5
  activerecord (>= 3.1, < 4.2)
6
6
  activesupport (>= 3.1, < 4.2)
7
7
  aes (~> 0.5.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- crypt_keeper (0.18.1)
4
+ crypt_keeper (0.18.2)
5
5
  activerecord (>= 3.1, < 4.2)
6
6
  activesupport (>= 3.1, < 4.2)
7
7
  aes (~> 0.5.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- crypt_keeper (0.18.1)
4
+ crypt_keeper (0.18.2)
5
5
  activerecord (>= 3.1, < 4.2)
6
6
  activesupport (>= 3.1, < 4.2)
7
7
  aes (~> 0.5.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- crypt_keeper (0.18.1)
4
+ crypt_keeper (0.18.2)
5
5
  activerecord (>= 3.1, < 4.2)
6
6
  activesupport (>= 3.1, < 4.2)
7
7
  aes (~> 0.5.0)
@@ -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
- send(field).force_encoding(crypt_keeper_encoding) if send(field).respond_to?(:force_encoding)
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
 
@@ -1,3 +1,3 @@
1
1
  module CryptKeeper
2
- VERSION = "0.18.2"
2
+ VERSION = "0.18.3"
3
3
  end
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.2
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-08-29 00:00:00.000000000 Z
11
+ date: 2014-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord