lib/kms_encrypted/database.rb in kms_encrypted-1.2.0 vs lib/kms_encrypted/database.rb in kms_encrypted-1.2.1

- old
+ new

@@ -41,14 +41,15 @@ end def decrypt(ciphertext) # determine version for context m = /\Av(\d+):/.match(ciphertext) - version = m ? m[1].to_i : 1 - context = (options[:upgrade_context] && !m) ? {} : context(version) + ciphertext_version = m ? m[1].to_i : 1 + context = (options[:upgrade_context] && !m) ? {} : context(ciphertext_version) KmsEncrypted::Box.new( key_id: key_id, + version: version, previous_versions: previous_versions ).decrypt(ciphertext, context: context) end private