ensl.org/app/uploaders/image_uploader.rb

20 lines
322 B
Ruby
Raw Normal View History

# encoding: utf-8
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
storage :file
def store_dir
2020-04-06 21:33:09 +00:00
File.join("local", "maps")
end
def filename
model.id.to_s + File.extname(@filename) unless @filename.nil?
end
def extension_white_list
%w(jpg jpeg gif png)
end
end