FIX: NoMethodError in on extension.upcase when upload's original filename has no extension.
This commit is contained in:
parent
cea5350a3c
commit
bf9f3c1366
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue