summaryrefslogtreecommitdiff
path: root/app/validators
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-04-05 01:54:45 +0900
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-04-06 23:46:59 +0900
commit4688eb47c6fe135fb9baad5a5d56b1dfa685cc7f (patch)
tree73ed8531a88ff7088ea419aa4518be02cd82f3ae /app/validators
parent1dbc888e3306f30ca0882aece86ccd1a817e0ab8 (diff)
downloadgitlab-ce-4688eb47c6fe135fb9baad5a5d56b1dfa685cc7f.tar.gz
Rename cron_time_zone to cron_timezone. Separate add_concurrent_foreign_key.
Diffstat (limited to 'app/validators')
-rw-r--r--app/validators/cron_timezone_validator.rb (renamed from app/validators/cron_time_zone_validator.rb)10
-rw-r--r--app/validators/cron_validator.rb2
2 files changed, 6 insertions, 6 deletions
diff --git a/app/validators/cron_time_zone_validator.rb b/app/validators/cron_timezone_validator.rb
index 9d4bbe1d458..542c7d006ad 100644
--- a/app/validators/cron_time_zone_validator.rb
+++ b/app/validators/cron_timezone_validator.rb
@@ -1,9 +1,9 @@
-# CronTimeZoneValidator
+# CronTimezoneValidator
#
-# Custom validator for CronTimeZone.
-class CronTimeZoneValidator < ActiveModel::EachValidator
+# Custom validator for CronTimezone.
+class CronTimezoneValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
- cron_parser = Gitlab::Ci::CronParser.new(record.cron, record.cron_time_zone)
- record.errors.add(attribute, " is invalid syntax") unless cron_parser.cron_time_zone_valid?
+ cron_parser = Gitlab::Ci::CronParser.new(record.cron, record.cron_timezone)
+ record.errors.add(attribute, " is invalid syntax") unless cron_parser.cron_timezone_valid?
end
end
diff --git a/app/validators/cron_validator.rb b/app/validators/cron_validator.rb
index cc07011d56b..981fade47a6 100644
--- a/app/validators/cron_validator.rb
+++ b/app/validators/cron_validator.rb
@@ -3,7 +3,7 @@
# Custom validator for Cron.
class CronValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
- cron_parser = Gitlab::Ci::CronParser.new(record.cron, record.cron_time_zone)
+ cron_parser = Gitlab::Ci::CronParser.new(record.cron, record.cron_timezone)
record.errors.add(attribute, " is invalid syntax") unless cron_parser.cron_valid?
end
end