1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/validators/timezone_validator.rb

12 lines
290 B
Ruby

# frozen_string_literal: true
class TimezoneValidator < ApplicationEachValidator
class Validation < Validation
TIMEZONE_RE = /\A-?\d\d:\d\d:00\z/.freeze
def perform
error! :blank if str_value.blank?
error! :timezone unless TIMEZONE_RE.match? value
end
end
end