From 3a519c2eee08b7ccb08685fcf2192c0836ac7c54 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sun, 22 Oct 2017 13:49:59 -0600 Subject: [PATCH] Skip validation of video duration if user is admin --- app/models/upload.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/upload.rb b/app/models/upload.rb index 569e5cf71..4d0704d24 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -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