Sha256: fbf3cf98908fba044610c831f862d2c28fbddb77a7b9b1f60b6a37f980b3d8e8
Contents?: true
Size: 661 Bytes
Versions: 2
Compression:
Stored size: 661 Bytes
Contents
# encoding: utf-8 module Fae class ImageUploader < CarrierWave::Uploader::Base include CarrierWave::MiniMagick # saves file size to DB process :save_file_size_in_model def save_file_size_in_model model.file_size = file.size end def extension_whitelist %w(jpg jpeg gif png ico) end # Override the directory where uploaded files will be stored. # This is a sensible default for uploaders that are meant to be mounted: def store_dir "system/uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end version :thumb do process :resize_to_fill => [150,100] end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
fae-rails-2.2.0 | app/uploaders/fae/image_uploader.rb |
fae-rails-2.1.0 | app/uploaders/fae/image_uploader.rb |