instance method transformations_by_name

Ruby on Rails 7.2.3

Since v7.1.6 Private

Available in: v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

transformations_by_name(transformations)

No documentation comment.

Parameters

transformations req
Source
# File activestorage/app/models/active_storage/attachment.rb, line 162
    def transformations_by_name(transformations)
      case transformations
      when Symbol
        variant_name = transformations
        named_variants.fetch(variant_name) do
          record_model_name = record.to_model.model_name.name
          raise ArgumentError, "Cannot find variant :#{variant_name} for #{record_model_name}##{name}"
        end.transformations
      else
        transformations
      end
    end

Defined in activestorage/app/models/active_storage/attachment.rb line 162 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveStorage::Attachment

Type at least 2 characters to search.

↑↓ navigate · open · esc close