Sha256: aff52f6e01fed709f5d29c0685525a871a8146bbe0e6afb849240b121f3152a6

Contents?: true

Size: 785 Bytes

Versions: 8

Compression:

Stored size: 785 Bytes

Contents

# encoding: utf-8
# frozen_string_literal: true
module C
  class ImageUploader < CarrierWave::Uploader::Base
    include CarrierWave::MiniMagick

    def store_dir
      "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    end

    version :thumbnail do
      process resize_and_pad: [150, 150]
    end

    version :preview do
      process resize_to_fit: [100, 100]
    end

    version :cropped_square do
      process resize_to_fill: [300, 300]
    end

    version :square do
      process resize_to_fit: [300, 300]
    end

    version :big_sq do
      process resize_and_pad: [600, 400]
    end

    version :large do
      process resize_to_fill: [1000, 600]
    end

    version :cropped_rect do
      process :resize_to_fill => [250, 100]
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cd2_catton_cms-1.1.35 app/uploaders/c/image_uploader.rb
cd2_catton_cms-1.1.34 app/uploaders/c/image_uploader.rb
cd2_catton_cms-1.1.33 app/uploaders/c/image_uploader.rb
cd2_catton_cms-1.1.32 app/uploaders/c/image_uploader.rb
cd2_catton_cms-1.1.31 app/uploaders/c/image_uploader.rb
cd2_catton_cms-1.1.30 app/uploaders/c/image_uploader.rb
cd2_catton_cms-1.1.20 app/uploaders/c/image_uploader.rb
cd2_catton_cms-1.1.10 app/uploaders/c/image_uploader.rb