Skip validation of video duration if user is admin
This commit is contained in:
@@ -101,8 +101,10 @@ class Upload < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def validate_video_duration
|
def validate_video_duration
|
||||||
if is_video? && video.duration > 120
|
unless uploader.is_admin?
|
||||||
raise "video must not be longer than 2 minutes"
|
if is_video? && video.duration > 120
|
||||||
|
raise "video must not be longer than 2 minutes"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user