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
2019-09-03 22:26:22 +05:00

11 lines
250 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! :timezone unless TIMEZONE_RE.match? value
end
end
end