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,8 +101,10 @@ class Upload < ApplicationRecord
end
def validate_video_duration
if is_video? && video.duration > 120
raise "video must not be longer than 2 minutes"
unless uploader.is_admin?
if is_video? && video.duration > 120
raise "video must not be longer than 2 minutes"
end
end
end
end