13 lines
254 B
Ruby
13 lines
254 B
Ruby
# encoding: utf-8
|
|
|
|
class AttachmentUploader < CarrierWave::Uploader::Base
|
|
storage :file
|
|
|
|
def store_dir
|
|
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
|
end
|
|
|
|
def image?
|
|
%w(png jpg jpeg).include?(file.extension)
|
|
end
|
|
end
|