Skip to content
Snippets Groups Projects
Commit ab191963 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

fix attachment uploader for aws

parent 2d83e43d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -8,6 +8,15 @@ class AttachmentUploader < CarrierWave::Uploader::Base
end
 
def image?
%w(png jpg jpeg).include?(file.extension)
img_ext = %w(png jpg jpeg)
if file.respond_to?(:extension)
img_ext.include?(file.extension)
else
# Not all CarrierWave storages respond to :extension
ext = file.path.split('.').last
img_ext.include?(ext)
end
rescue
false
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment