Commit d48658e3 authored by Shinya Maeda's avatar Shinya Maeda

Use constraint for #validation

parent 13bac4c2
...@@ -12,8 +12,10 @@ module Ci ...@@ -12,8 +12,10 @@ module Ci
end end
def validation def validation
is_valid_cron = try_parse_cron(@cron, 'Europe/Istanbul').present? VALID_SYNTAX_TIME_ZONE = 'Europe/Istanbul'
is_valid_cron_time_zone = try_parse_cron('* * * * *', @cron_time_zone).present? VALID_SYNTAX_CRON = '* * * * *'
is_valid_cron = try_parse_cron(@cron, VALID_SYNTAX_TIME_ZONE).present?
is_valid_cron_time_zone = try_parse_cron(VALID_SYNTAX_CRON, @cron_time_zone).present?
return is_valid_cron, is_valid_cron_time_zone return is_valid_cron, is_valid_cron_time_zone
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment