method
try_to_decrypt_with_each
v8.0.0 -
Show latest stable
- Class:
ActiveRecord::Encryption::Cipher
try_to_decrypt_with_each(encrypted_text, keys:)private
No documentation available.
# File activerecord/lib/active_record/encryption/cipher.rb, line 40
def try_to_decrypt_with_each(encrypted_text, keys))
keys.each.with_index do |key, index|
return cipher_for(key).decrypt(encrypted_text)
rescue ActiveRecord::Encryption::Errors::Decryption
raise if index == keys.length - 1
end
end