FIX: NoMethodError in on extension.upcase when upload's original filename has no extension.

This commit is contained in:
Jens Maier 2014-07-15 03:15:17 +02:00
parent cea5350a3c
commit bf9f3c1366
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ module Validators; end
class Validators::UploadValidator < ActiveModel::Validator
def validate(upload)
extension = File.extname(upload.original_filename)[1..-1]
extension = File.extname(upload.original_filename)[1..-1] || ""
if is_authorized?(upload, extension)
if FileHelper.is_image?(upload.original_filename)