Merge pull request #3344 from hakusaro/change-duration

Skip validation of video duration if user is admin
This commit is contained in:
Albert Yi
2017-10-25 18:03:04 -07:00
committed by GitHub

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