instance method processed

Ruby on Rails 5.2.8.1

Since v5.2.8.1

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

processed()

Processes the preview if it has not been processed yet. Returns the receiving Preview instance for convenience:

blob.preview(resize: "100x100").processed.service_url

Processing a preview generates an image from its blob and attaches the preview image to the blob. Because the preview image is stored with the blob, it is only generated once.

Source
# File activestorage/app/models/active_storage/preview.rb, line 45
  def processed
    process unless processed?
    self
  end

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

Defined in ActiveStorage::Preview

Type at least 2 characters to search.

↑↓ navigate · open · esc close