Add `ActiveSupport` load hook for `ActionText::EncryptedRichText`

Both `ActionText::Record` and `ActionText::RichText` have dedicated `ActiveSupport` load hooks. This adds an
additional hook for `ActionText::EncryptedRichText`, so that external libraries have a similarly simple way
to run code after the subclass is loaded.
This commit is contained in:
justin talbott 2023-03-22 16:00:08 -04:00
parent e55ccf0f10
commit beb43e0182
No known key found for this signature in database
GPG Key ID: D227E20FD8BF1256
2 changed files with 3 additions and 0 deletions

View File

@ -7,3 +7,5 @@ module ActionText
encrypts :body
end
end
ActiveSupport.run_load_hooks :action_text_encrypted_rich_text, ActionText::EncryptedRichText

View File

@ -1488,6 +1488,7 @@ These are the load hooks you can use in your own code. To hook into the initiali
| `ActionText::Content` | `action_text_content` |
| `ActionText::Record` | `action_text_record` |
| `ActionText::RichText` | `action_text_rich_text` |
| `ActionText::EncryptedRichText` | `action_text_encrypted_rich_text` |
| `ActionView::Base` | `action_view` |
| `ActionView::TestCase` | `action_view_test_case` |
| `ActiveJob::Base` | `active_job` |