Class: ActiveStorageDashboard::VariantRegenerator
- Inherits:
-
Object
- Object
- ActiveStorageDashboard::VariantRegenerator
- Defined in:
- lib/active_storage_dashboard/variant_regenerator.rb
Class Method Summary collapse
Class Method Details
.call ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/active_storage_dashboard/variant_regenerator.rb', line 3 def self.call unless defined?(ActiveStorage::VariantRecord) puts "ActiveStorage::VariantRecord not found (Rails < 7.1). Skipping." return end ActiveStorage::VariantRecord.find_each do |variant| begin variant.image.representation(variant.variation).processed rescue => e warn "Failed variant #{variant.id}: #{e.message}" end end end |