class method self.with_all_variant_records

Ruby on Rails 7.2.3

Since v7.1.6

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

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.

↑↓ navigate · open · esc close