class method self.with_all_variant_records

Ruby on Rails 7.2.3.2

Since v7.1.6

Available in: v7.1.6 v7.2.3.2 v8.0.5.1 v8.1.3.1 edge

Eager load all variant records on an attachment at once.

User.first.avatars.with_all_variant_records
Source
# File activestorage/app/models/active_storage/attachment.rb, line 45
  scope :with_all_variant_records, -> { includes(blob: {
    variant_records: { image_attachment: :blob },
    preview_image_attachment: { blob: { variant_records: { image_attachment: :blob } } }

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

Defined in ActiveStorage::Attachment

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close