Skip to content
  • Hartley McGuire's avatar
    684e7609
    Load configured Active Storage plugins during boot · 684e7609
    Hartley McGuire authored
    Previously, the parts of Active Storage using ruby-vips, mini_magick, or
    image_processing would try to load gems only when used. This strategy works
    well because it allows apps that don't need these features to easily
    ignore them and not have to depend on gems they don't need.
    
    However, the downsides to this strategy are that it requires loading
    code during requests and that it moves potential error messages into request
    logs instead of those errors being immediately visible on boot.
    
    This commit addresses these issues by restructing how the Vips and Image
    Magick transformers/analyzers are organized so that they will be loaded
    (if configured) on boot along with whatever dependencies they need.
    
    For now, if :vips or :mini_magick is specified as the Active Storage
    :variant_processor, not having the required gem in the Gemfile will print a
    deprecation warning instead of erroring because it is likely many apps
    are currently configured this way.
    684e7609
    Load configured Active Storage plugins during boot
    Hartley McGuire authored
    Previously, the parts of Active Storage using ruby-vips, mini_magick, or
    image_processing would try to load gems only when used. This strategy works
    well because it allows apps that don't need these features to easily
    ignore them and not have to depend on gems they don't need.
    
    However, the downsides to this strategy are that it requires loading
    code during requests and that it moves potential error messages into request
    logs instead of those errors being immediately visible on boot.
    
    This commit addresses these issues by restructing how the Vips and Image
    Magick transformers/analyzers are organized so that they will be loaded
    (if configured) on boot along with whatever dependencies they need.
    
    For now, if :vips or :mini_magick is specified as the Active Storage
    :variant_processor, not having the required gem in the Gemfile will print a
    deprecation warning instead of erroring because it is likely many apps
    are currently configured this way.
Loading