remove zoom url validation

This commit is contained in:
Bilal
2020-07-22 14:05:31 +02:00
parent 95e9a70c4b
commit e08dd36d68
4 changed files with 6 additions and 60 deletions

View File

@@ -6,7 +6,6 @@ class CastingSubmission < ApplicationRecord
has_secure_token
validates :performer_name, presence: true
validate :zoom_meeting_url_validation
scope :completed, -> { where.not(interviewed_at: nil) }
@@ -21,19 +20,4 @@ class CastingSubmission < ApplicationRecord
def zip_file_name
"#{self.casting_call.title.parameterize}_#{self.performer_name.parameterize}_#{Time.now.strftime('%Y-%m-%d_%H-%M-%S')}"
end
def zoom_meeting_url_validation
# valid url format :
# https://us01web.zoom.us/j/12345?pwd=Ab103odw3ok343ko
valid_url_regex = %r{^https\://[a-z0-9]+\.zoom.us/j/[0-9]+\?pwd\=.+}
return true if zoom_meeting_url.match valid_url_regex
errors.add(:base, invalid_meeting_url_message)
end
private
def invalid_meeting_url_message
I18n.t('casting_submissions.validation_errors.invalid_meeting_url')
end
end