class ActiveStorage::Service::CloudinaryService

def public_id(key, filename = nil, content_type = '')

Returns:
  • (string) - The public id of the asset.

Parameters:
  • content_type (string) -- The content type of the file.
  • filename (ActiveStorage::Filename) -- The original filename.
  • key (ActiveStorage::BlobKey) -- The blob key with attributes.
def public_id(key, filename = nil, content_type = '')
  public_id = key
  if resource_type(nil, key) == 'raw'
    public_id = [key, ext_for_file(key, filename, content_type)].reject(&:blank?).join('.')
  end
  full_public_id_internal(public_id)
end