Skip to content
  • Shouichi Kamiya's avatar
    b1c544b1
    Add an option to preprocessed AS variants · b1c544b1
    Shouichi Kamiya authored
    ActiveStorage variants are processed on the fly when they are needed but
    sometimes we're sure that they are accessed and want to processed them
    upfront.
    
    `preprocessed` option is added when declaring variants.
    
    ```
    class User < ApplicationRecord
      has_one_attached :avatar do |attachable|
        attachable.variant :thumb, resize_to_limit: [100, 100], preprocessed: true
      end
    end
    ```
    b1c544b1
    Add an option to preprocessed AS variants
    Shouichi Kamiya authored
    ActiveStorage variants are processed on the fly when they are needed but
    sometimes we're sure that they are accessed and want to processed them
    upfront.
    
    `preprocessed` option is added when declaring variants.
    
    ```
    class User < ApplicationRecord
      has_one_attached :avatar do |attachable|
        attachable.variant :thumb, resize_to_limit: [100, 100], preprocessed: true
      end
    end
    ```
Loading