lib/kms_encrypted/model.rb in kms_encrypted-1.3.0 vs lib/kms_encrypted/model.rb in kms_encrypted-1.4.0
- old
+ new
@@ -121,10 +121,10 @@
# decrypt
plaintext_attributes = {}
# attr_encrypted
if self.class.respond_to?(:encrypted_attributes)
- self.class.encrypted_attributes.each do |key, v|
+ self.class.encrypted_attributes.to_a.each do |key, v|
if v[:key] == key_method.to_sym
plaintext_attributes[key] = send(key)
elsif v[:key].respond_to?(:call)
warn "[kms_encrypted] Can't detect if encrypted attribute uses this key"
end