method

try_to_decrypt_with_each

Importance_0
v7.0.0 - Show latest stable - 0 notes - Class: Cipher
try_to_decrypt_with_each(encrypted_text, keys:) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# 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
Register or log in to add new notes.