class
ActiveStorage::VariantRecord
- ActiveStorage::VariantRecord
- Marten::DB::Model
- Reference
- Object
Overview
Row linking a blob to one of its processed variants.
Rails writes one of these per variation when config.active_storage.track_variants is on, which
is the default from load_defaults 6.1 onwards. The variant image itself is a separate blob,
attached to this record under the name #image.
https://github.com/rails/rails/blob/v8.1.3/activestorage/app/models/active_storage/variant_record.rb
Defined in:
active_storage/variant_record.crConstant Summary
-
FIELDS_ =
{"id" => {type: "big_int", kwargs: {primary_key: true, auto: true}}, "blob" => {type: "many_to_one", kwargs: {to: ActiveStorage::Blob}}, "variation_digest" => {type: "string", kwargs: {max_size: 255}}} of Nil => Nil -
Row linking a blob to one of its processed variants.
Rails writes one of these per variation when
config.active_storage.track_variantsis on, which is the default fromload_defaults 6.1onwards. The variant image itself is a separate blob, attached to this record under the name#image. https://github.com/rails/rails/blob/v8.1.3/activestorage/app/models/active_storage/variant_record.rb -
IMAGE_ATTACHMENT_NAME =
"image" -
Name the variant blob is attached to this record under.
-
RECORD_TYPE =
"ActiveStorage::VariantRecord" -
Value the variant attachment rows carry in their
record_typecolumn.
Instance Method Summary
- #blob : ActiveStorage::Blob | Nil
- #blob! : ActiveStorage::Blob
- #blob=(related_object : ActiveStorage::Blob | Nil)
- #blob?
- #blob_id : Marten::DB::Field::ReferenceDBTypes | Nil
- #blob_id!
- #blob_id=(related_id : Marten::DB::Field::ReferenceDBTypes | Nil)
- #blob_id?
- #id : Int32 | Int64 | Nil | Nil
- #id!
- #id=(id : Int32 | Int64 | Nil | Nil)
- #id?
-
#image : ActiveStorage::Blob | Nil
Returns the blob holding the processed variant image, or
nilwhen it is not attached. - #variation_digest : String | Nil | Nil
- #variation_digest!
- #variation_digest=(variation_digest : String | Nil | Nil)
- #variation_digest?
Instance Method Detail
Returns the blob holding the processed variant image, or nil when it is not attached.