instance method protecting_encrypted_data

Ruby on Rails 7.0.10

Since v7.0.10

Available in: v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

protecting_encrypted_data(&block)

Runs the provided block in an encryption context where:

  • Reading encrypted content will return its ciphertext.

  • Writing encrypted content will fail.

Parameters

block block
Source
# File activerecord/lib/active_record/encryption/contexts.rb, line 57
        def protecting_encrypted_data(&block)
          with_encryption_context encryptor: ActiveRecord::Encryption::EncryptingOnlyEncryptor.new, frozen_encryption: true, &block
        end

Defined in activerecord/lib/active_record/encryption/contexts.rb line 57 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Encryption::Contexts

Type at least 2 characters to search.

↑↓ navigate · open · esc close