Sha256: 7cab384b61b6b78b29035f3d94e23e9e8f77e4c837a12eeda2437fca83cfa104

Contents?: true

Size: 502 Bytes

Versions: 2

Compression:

Stored size: 502 Bytes

Contents

module Loft
  module AssetFileUploader
    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
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
loft-0.1.2 lib/concerns/asset_file_uploader.rb
loft-0.1.1 lib/concerns/asset_file_uploader.rb