This commit is contained in:
r888888888
2014-11-19 17:17:26 -08:00
parent 11731b6dfb
commit 177ef0ebcc
5 changed files with 21 additions and 0 deletions

View File

@@ -48,4 +48,8 @@ class PixivUgoiraService
@content_type = data[:ugoira_content_type]
end
end
def empty?
@frame_data.nil?
end
end

View File

@@ -53,6 +53,10 @@ class Upload < ActiveRecord::Base
unless is_valid_content_type?
raise "invalid content type (only JPEG, PNG, GIF, SWF, and WebM files are allowed)"
end
if is_ugoira? && ugoira_service.empty?
raise "missing frame data for ugoira"
end
end
def validate_md5_confirmation