attr_keyring 0.3.0 → 0.3.1

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
  SHA256:
3
- metadata.gz: fd14faa33fac1e6f05f9e66ca58f23f1d25b2ac283a81c0592a443e4141da54b
4
- data.tar.gz: b1a5ee0e2351b0ba7662355cacf834de59e21192b3e3e297e3a9116189a528d5
3
+ metadata.gz: 74bd2df52ec8dcaf0295310f9755c36ff64a9185b6ef80a45470173de5a3bd19
4
+ data.tar.gz: 3471acffc4bcc55ef81ee715e8c4363d00c95f6b81cb559fb123d4f28cbb13f0
5
5
  SHA512:
6
- metadata.gz: dcee2d1e763ae6386f82d5012504597a7a37011e89680fae7dbae5ede27589d6a08b852bf40518cbafa4c3bd91879a33ca54df59f2a77d0c587ef657d10897f0
7
- data.tar.gz: 4112694e88e9c8bf2a6676f99dd70504fec0ed79e6e0ccf2c397a32680d7b0028e1a622750d700e4be67693aa6c0fac16c4b9598296b40d84ed3d9880db13b3c
6
+ metadata.gz: 06277ed16d197dc8910b40960b85784072bf6fc4c544b95e59c13044a7cc02c514eec014aea016004039cbfbbfaa87adece295eb0b81e36ecf83de593ee05e01
7
+ data.tar.gz: 00a790ac4d5d5bae7fa76c4a6023281fcf58b71839b22efb173e1d3fbe7ac65aa630ff2f8b877baead2e24c394584ec4e799f877e461e7e9ca8bc04ccd5bcb39
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- attr_keyring (0.3.0)
4
+ attr_keyring (0.3.1)
5
5
  activerecord
6
6
 
7
7
  GEM
@@ -52,7 +52,7 @@ module AttrKeyring
52
52
  module InstanceMethods
53
53
  private def attr_reset_column(attribute)
54
54
  public_send("encrypted_#{attribute}=", nil)
55
- public_send("#{attribute}_digest=", nil)
55
+ public_send("#{attribute}_digest=", nil) if respond_to?("#{attribute}_digest=")
56
56
  nil
57
57
  end
58
58
 
@@ -66,6 +66,8 @@ module AttrKeyring
66
66
 
67
67
  self.class.keyring_attrs.each do |attribute, options|
68
68
  value = public_send(attribute)
69
+ next if value.nil?
70
+
69
71
  encrypted_value = self.class.keyring.encrypt(value, keyring_id)
70
72
  encrypted_value = Base64.strict_encode64(encrypted_value) if options[:encode]
71
73
 
@@ -1,3 +1,3 @@
1
1
  module AttrKeyring
2
- VERSION = "0.3.0".freeze
2
+ VERSION = "0.3.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attr_keyring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira