method
encrypted_attribute?
v8.0.0 -
Show latest stable
- Class:
ActiveRecord
encrypted_attribute?(attribute_name)public
Returns whether a given attribute is encrypted or not.
# 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 Related methods
- Instance methods
- ciphertext_for
- decrypt
- encrypt
- encrypted_attribute?
- Class methods
- action_on_strict_loading_violation
- after_all_transactions_commit
- all_open_transactions
- async_query_executor
- db_warnings_action
- db_warnings_action=
- db_warnings_ignore
- default_timezone=
- deprecator
- disconnect_all!
- dump_schema_after_migration
- dump_schemas
- eager_load!
- error_on_ignored_order
- gem_version
- generate_secure_token_on
- global_executor_concurrency
- global_executor_concurrency=
- global_thread_pool_async_query_executor
- lazily_load_schema_cache
- marshalling_format_version
- marshalling_format_version=
- migration_strategy
- permanent_connection_checkout=
- protocol_adapters
- queues
- raise_int_wider_than_64bit
- schema_cache_ignored_table?
- schema_cache_ignored_tables
- schema_format
- timestamped_migrations
- use_yaml_unsafe_load
- validate_migration_timestamps
- verbose_query_logs
- verify_foreign_keys_for_fixtures
- version
- yaml_column_permitted_classes
- Private methods
-
_create -
_create! -
_create_record -
_new -
build_decrypt_attribute_assignments -
build_encrypt_attribute_assignments -
cant_modify_encrypted_attributes_when_frozen -
decrypt_attributes -
encrypt_attributes -
exec_queries -
has_encrypted_attributes? -
validate_encryption_allowed