diff --git a/app/helpers/embed_videos_helper.rb b/app/helpers/embed_videos_helper.rb index af4f23ac2..08a3179f8 100644 --- a/app/helpers/embed_videos_helper.rb +++ b/app/helpers/embed_videos_helper.rb @@ -1,6 +1,6 @@ module EmbedVideosHelper - VIMEO_REGEX = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/.freeze - YOUTUBE_REGEX = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/.freeze + VIMEO_REGEX = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/ + YOUTUBE_REGEX = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/ def embedded_video_code(resource) link = resource.video_url diff --git a/app/models/legislation/process.rb b/app/models/legislation/process.rb index a0b28c3fd..bd661338c 100644 --- a/app/models/legislation/process.rb +++ b/app/models/legislation/process.rb @@ -24,7 +24,7 @@ class Legislation::Process < ApplicationRecord PHASES_AND_PUBLICATIONS = %i[homepage_phase draft_phase debate_phase allegations_phase proposals_phase draft_publication result_publication].freeze - CSS_HEX_COLOR = /\A#?(?:[A-F0-9]{3}){1,2}\z/i.freeze + CSS_HEX_COLOR = /\A#?(?:[A-F0-9]{3}){1,2}\z/i has_many :draft_versions, -> { order(:id) }, foreign_key: "legislation_process_id", diff --git a/app/models/poll/question/answer/video.rb b/app/models/poll/question/answer/video.rb index 5f5407bcc..6cf9e7cc6 100644 --- a/app/models/poll/question/answer/video.rb +++ b/app/models/poll/question/answer/video.rb @@ -1,8 +1,8 @@ class Poll::Question::Answer::Video < ApplicationRecord belongs_to :answer, class_name: "Poll::Question::Answer" - VIMEO_REGEX = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/.freeze - YOUTUBE_REGEX = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/.freeze + VIMEO_REGEX = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/ + YOUTUBE_REGEX = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/ validates :title, presence: true validate :valid_url? diff --git a/app/models/progress_bar.rb b/app/models/progress_bar.rb index cf20c0d2e..700b9dc09 100644 --- a/app/models/progress_bar.rb +++ b/app/models/progress_bar.rb @@ -1,6 +1,6 @@ class ProgressBar < ApplicationRecord self.inheritance_column = nil - RANGE = (0..100).freeze + RANGE = (0..100) enum kind: %i[primary secondary]