Skip validation of video duration if user is admin

This commit is contained in:
Lucas Nicodemus
2017-10-22 13:49:59 -06:00
parent 361196aca4
commit 3a519c2eee

View File

@@ -101,11 +101,13 @@ class Upload < ApplicationRecord
end end
def validate_video_duration def validate_video_duration
unless uploader.is_admin?
if is_video? && video.duration > 120 if is_video? && video.duration > 120
raise "video must not be longer than 2 minutes" raise "video must not be longer than 2 minutes"
end end
end end
end end
end
module ConversionMethods module ConversionMethods
def process_upload def process_upload