Sha256: 0327c130f8edd8eb9d254c52db49b64926e3ca72baa6b2ec78149ed6e9211194
Contents?: true
Size: 569 Bytes
Versions: 2
Compression:
Stored size: 569 Bytes
Contents
module C80SocialNetworks class TypeIconUploader < CarrierWave::Uploader::Base include CarrierWave::MiniMagick storage :file process :resize_to_limit => [100, 100] def store_dir "uploads/social_networks" end def filename if original_filename "icon_#{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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
c80_social_networks-0.1.0.2 | app/uploaders/c80_social_networks/type_icon_uploader.rb |
c80_social_networks-0.1.0.1 | app/uploaders/c80_social_networks/type_icon_uploader.rb |