mirror of https://github.com/rails/rails
Merge pull request #42740 from dmarcoux/document-active_storage-attachment-variant
Document ActiveStorage::Attachment#variant
This commit is contained in:
commit
c0911e9a36
|
@ -47,6 +47,13 @@ class ActiveStorage::Attachment < ActiveStorage::Record
|
|||
blob&.purge_later
|
||||
end
|
||||
|
||||
# Returns an ActiveStorage::Variant or ActiveStorage::VariantWithRecord
|
||||
# instance for the attachment with the set of +transformations+ provided.
|
||||
# See ActiveStorage::Blob::Representable#variant for more information.
|
||||
#
|
||||
# Raises an +ArgumentError+ if +transformations+ is a +Symbol+ which is an
|
||||
# unknown pre-defined variant of the attachment.
|
||||
|
||||
def variant(transformations)
|
||||
case transformations
|
||||
when Symbol
|
||||
|
|
Loading…
Reference in New Issue