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

13 lines
290 B
Ruby
Raw Normal View History

2019-09-03 13:26:22 -04:00
# 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?
2019-09-03 13:26:22 -04:00
error! :timezone unless TIMEZONE_RE.match? value
end
end
end