instance method
encrypted_attribute?
Ruby on Rails 7.1.6
Since v7.0.10Signature
encrypted_attribute?(attribute_name)
Returns whether a given attribute is encrypted or not.
Parameters
-
attribute_namereq
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