mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Representable docs: Refer to the 'variant processor' not ImageMagick
This commit is contained in:
parent
6442aac195
commit
ebb9df43e0
2 changed files with 6 additions and 4 deletions
|
@ -28,8 +28,9 @@ module ActiveStorage::Blob::Representable
|
|||
# This will create a URL for that specific blob with that specific variant, which the ActiveStorage::RepresentationsController
|
||||
# can then produce on-demand.
|
||||
#
|
||||
# Raises ActiveStorage::InvariableError if ImageMagick cannot transform the blob. To determine whether a blob is
|
||||
# variable, call ActiveStorage::Blob#variable?.
|
||||
# Raises ActiveStorage::InvariableError if the variant processor cannot
|
||||
# transform the blob. To determine whether a blob is variable, call
|
||||
# ActiveStorage::Blob#variable?.
|
||||
def variant(transformations)
|
||||
if variable?
|
||||
variant_class.new(self, ActiveStorage::Variation.wrap(transformations).default_to(default_variant_transformations))
|
||||
|
@ -38,7 +39,8 @@ module ActiveStorage::Blob::Representable
|
|||
end
|
||||
end
|
||||
|
||||
# Returns true if ImageMagick can transform the blob (its content type is in +ActiveStorage.variable_content_types+).
|
||||
# Returns true if the variant processor can transform the blob (its content
|
||||
# type is in +ActiveStorage.variable_content_types+).
|
||||
def variable?
|
||||
ActiveStorage.variable_content_types.include?(content_type)
|
||||
end
|
||||
|
|
|
@ -31,7 +31,7 @@ module ActiveStorage
|
|||
if name.to_s == "combine_options"
|
||||
raise ArgumentError, <<~ERROR.squish
|
||||
Active Storage's ImageProcessing transformer doesn't support :combine_options,
|
||||
as it always generates a single ImageMagick command.
|
||||
as it always generates a single command.
|
||||
ERROR
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue