mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add load hook for ActiveStorage::VariantRecord
Add a load hook called `active_storage_variant_record` (providing `ActiveStorage::VariantRecord`) to allow for overriding aspects of the `ActiveStorage::VariantRecord` class. This makes `ActiveStorage::VariantRecord` consistent with `ActiveStorage::Blob` and `ActiveStorage::Attachment` that already have load hooks.
This commit is contained in:
parent
fc3e0f9dcf
commit
516ff29584
3 changed files with 10 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
* Add a load hook called `active_storage_variant_record` (providing `ActiveStorage::VariantRecord`)
|
||||
to allow for overriding aspects of the `ActiveStorage::VariantRecord` class. This makes
|
||||
`ActiveStorage::VariantRecord` consistent with `ActiveStorage::Blob` and `ActiveStorage::Attachment`
|
||||
that already have load hooks.
|
||||
|
||||
*Brendon Muir*
|
||||
|
||||
* `ActiveStorage::PreviewError` is raised when a previewer is unable to generate a preview image.
|
||||
|
||||
*Alex Robbin*
|
||||
|
|
|
@ -6,3 +6,5 @@ class ActiveStorage::VariantRecord < ActiveStorage::Record
|
|||
belongs_to :blob
|
||||
has_one_attached :image
|
||||
end
|
||||
|
||||
ActiveSupport.run_load_hooks :active_storage_variant_record, ActiveStorage::VariantRecord
|
||||
|
|
|
@ -1525,6 +1525,7 @@ These are the load hooks you can use in your own code. To hook into the initiali
|
|||
| `ActiveJob::TestCase` | `active_job_test_case` |
|
||||
| `ActiveRecord::Base` | `active_record` |
|
||||
| `ActiveStorage::Attachment` | `active_storage_attachment` |
|
||||
| `ActiveStorage::VariantRecord` | `active_storage_variant_record` |
|
||||
| `ActiveStorage::Blob` | `active_storage_blob` |
|
||||
| `ActiveStorage::Record` | `active_storage_record` |
|
||||
| `ActiveSupport::TestCase` | `active_support_test_case` |
|
||||
|
|
Loading…
Reference in a new issue