instance method on_encrypted_attribute_declared

Ruby on Rails 8.0.4

Since v7.0.10

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

Signature

on_encrypted_attribute_declared(&block)

Register callback to be invoked when an encrypted attribute is declared.

Example

ActiveRecord::Encryption.on_encrypted_attribute_declared do |klass, attribute_name|
  ...
end

Parameters

block block
Source
# File activerecord/lib/active_record/encryption/configurable.rb, line 47
        def on_encrypted_attribute_declared(&block)
          self.encrypted_attribute_declaration_listeners ||= Concurrent::Array.new
          self.encrypted_attribute_declaration_listeners << block
        end

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

Defined in ActiveRecord::Encryption::Configurable

Type at least 2 characters to search.

↑↓ navigate · open · esc close