instance method encrypt_attribute

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

encrypt_attribute(name, attribute_scheme)

No documentation comment.

Parameters

name req
attribute_scheme req
Source
# File activerecord/lib/active_record/encryption/encryptable_record.rb, line 82
          def encrypt_attribute(name, attribute_scheme)
            encrypted_attributes << name.to_sym

            attribute name do |cast_type|
              ActiveRecord::Encryption::EncryptedAttributeType.new scheme: attribute_scheme, cast_type: cast_type
            end

            preserve_original_encrypted(name) if attribute_scheme.ignore_case?
            ActiveRecord::Encryption.encrypted_attribute_was_declared(self, name)
          end

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

Defined in ActiveRecord::Encryption::EncryptableRecord

Type at least 2 characters to search.

↑↓ navigate · open · esc close