Remove duplication in code to validate video URL
We were using the same code, and the same regular expressions, in two places. To do so, we were including a helper inside a model, which is something we don't usually do.
This commit is contained in:
@@ -14,7 +14,7 @@ class Proposal < ApplicationRecord
|
||||
include Mappable
|
||||
include Notifiable
|
||||
include Documentable
|
||||
include EmbedVideosHelper
|
||||
include Videoable
|
||||
include Relationable
|
||||
include Milestoneable
|
||||
include Randomizable
|
||||
@@ -59,8 +59,6 @@ class Proposal < ApplicationRecord
|
||||
|
||||
validates :terms_of_service, acceptance: { allow_nil: false }, on: :create
|
||||
|
||||
validate :valid_video_url?
|
||||
|
||||
before_validation :set_responsible_name
|
||||
|
||||
before_save :calculate_hot_score, :calculate_confidence_score
|
||||
|
||||
Reference in New Issue
Block a user