Sha256: 40bd54785c7183fb5d4842439caf271671238d07fb0145de0463b439ef411fd9
Contents?: true
Size: 579 Bytes
Versions: 36
Compression:
Stored size: 579 Bytes
Contents
module C80MapFloors class MapImageUploader < CarrierWave::Uploader::Base include CarrierWave::MiniMagick storage :file version :thumb do process :resize_to_fit => [500,500] end def store_dir "uploads/map/" end def filename if original_filename "map_#{secure_token(4)}.#{file.extension}" end end protected def secure_token(length=16) var = :"@#{mounted_as}_secure_token" model.instance_variable_get(var) or model.instance_variable_set(var, SecureRandom.hex(length/2)) end end end
Version data entries
36 entries across 36 versions & 1 rubygems