Validate format of `sharing_custom_url`

This commit is contained in:
Andreas Nedbal 2023-02-05 20:24:40 +01:00 committed by Andreas Nedbal
parent 8f0ae5171d
commit 47d1f5ccff
1 changed files with 1 additions and 0 deletions

View File

@ -61,6 +61,7 @@ class User < ApplicationRecord # rubocop:disable Metrics/ClassLength
end end
validates :email, fake_email: true, typoed_email: true validates :email, fake_email: true, typoed_email: true
validates :sharing_custom_url, format: URI::DEFAULT_PARSER.make_regexp(%w[http https])
validates :screen_name, validates :screen_name,
presence: true, presence: true,
format: { with: SCREEN_NAME_REGEX, message: I18n.t("activerecord.validation.user.screen_name.format") }, format: { with: SCREEN_NAME_REGEX, message: I18n.t("activerecord.validation.user.screen_name.format") },