Sha256: 2f53d73c134a90de8810ce004aa26e9e3a09a037a078fde98c1b30839c6ec3da
Contents?: true
Size: 665 Bytes
Versions: 1
Compression:
Stored size: 665 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_allowlist %w(jpg jpeg gif png ico svg) 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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fae-rails-3.0.0 | app/uploaders/fae/image_uploader.rb |