We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de8d345 commit 1cfeca9Copy full SHA for 1cfeca9
activestorage/app/models/active_storage/attachment.rb
@@ -47,6 +47,13 @@ def purge_later
47
blob&.purge_later
48
end
49
50
+ # Returns an ActiveStorage::Variant or ActiveStorage::VariantWithRecord
51
+ # instance for the attachment with the set of +transformations+ provided.
52
+ # See ActiveStorage::Blob::Representable#variant for more information.
53
+ #
54
+ # Raises an +ArgumentError+ if +transformations+ is a +Symbol+ which is an
55
+ # unknown pre-defined variant of the attachment.
56
+
57
def variant(transformations)
58
case transformations
59
when Symbol
0 commit comments