class method
self.with_all_variant_records
Ruby on Rails 7.2.3
Since v7.1.6Eager 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