Add pre-defined variant examples

This commit is contained in:
Deepak Mahakale 2022-10-10 15:15:22 +05:30
parent 3258979977
commit 0d1633c8c7

@ -49,6 +49,14 @@ def purge_later
# Returns an ActiveStorage::Variant or ActiveStorage::VariantWithRecord
# instance for the attachment with the set of +transformations+ provided.
# Example:
#
# avatar.variant(resize_to_limit: [100, 100]).processed.url
#
# or if you are using pre-defined variants:
#
# avatar.variant(:thumb).processed.url
#
# See ActiveStorage::Blob::Representable#variant for more information.
#
# Raises an +ArgumentError+ if +transformations+ is a +Symbol+ which is an
@ -60,6 +68,14 @@ def variant(transformations)
# Returns an ActiveStorage::Preview instance for the attachment with the set
# of +transformations+ provided.
# Example:
#
# video.preview(resize_to_limit: [100, 100]).processed.url
#
# or if you are using pre-defined variants:
#
# video.preview(:thumb).processed.url
#
# See ActiveStorage::Blob::Representable#preview for more information.
#
# Raises an +ArgumentError+ if +transformations+ is a +Symbol+ which is an
@ -71,6 +87,14 @@ def preview(transformations)
# Returns an ActiveStorage::Preview or an ActiveStorage::Variant for the
# attachment with set of +transformations+ provided.
# Example:
#
# avatar.representation(resize_to_limit: [100, 100]).processed.url
#
# or if you are using pre-defined variants:
#
# avatar.representation(:thumb).processed.url
#
# See ActiveStorage::Blob::Representable#representation for more information.
#
# Raises an +ArgumentError+ if +transformations+ is a +Symbol+ which is an