instance method encrypted_attribute?

Ruby on Rails 7.1.6

Since v7.0.10

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

Signature

encrypted_attribute?(attribute_name)

Returns whether a given attribute is encrypted or not.

Parameters

attribute_name req
Source
# File activerecord/lib/active_record/encryption/encryptable_record.rb, line 146
      def encrypted_attribute?(attribute_name)
        name = attribute_name.to_s
        name = self.class.attribute_aliases[name] || name

        return false unless self.class.encrypted_attributes&.include? name.to_sym

        type = type_for_attribute(name)
        type.encrypted? read_attribute_before_type_cast(name)
      end

Defined in activerecord/lib/active_record/encryption/encryptable_record.rb line 146 · 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