Sha256: 6c3d141a22c97f39a196b285899ede5c76f17db2221bba13e6e1b2816893514f

Contents?: true

Size: 456 Bytes

Versions: 10

Compression:

Stored size: 456 Bytes

Contents

module LoftAssetFileUploader
  extend ActiveSupport::Concern

  included do
    include CarrierWave::MiniMagick

    def store_dir
      "loft/#{ model._number }"
    end


    version :_200x150_2x, if: :is_image? do
      process :resize_to_fill => [400, 300]
    end


    version :_40x40_2x, if: :is_image? do
      process :resize_to_fill => [80, 80]
    end


    def is_image? new_file
      model.is_image?
    end
    private :is_image?

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
loft-0.3.1 app/models/concerns/loft_asset_file_uploader.rb
loft-0.3.0 app/models/concerns/loft_asset_file_uploader.rb
loft-0.2.9 app/models/concerns/loft_asset_file_uploader.rb
loft-0.2.8 app/models/concerns/loft_asset_file_uploader.rb
loft-0.2.7 app/models/concerns/loft_asset_file_uploader.rb
loft-0.2.6 app/models/concerns/loft_asset_file_uploader.rb
loft-0.2.5 app/models/concerns/loft_asset_file_uploader.rb
loft-0.2.4 app/models/concerns/loft_asset_file_uploader.rb
loft-0.2.3 app/models/concerns/loft_asset_file_uploader.rb
loft-0.2.2 app/models/concerns/loft_asset_file_uploader.rb