Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/validators/line_code_validator.rb')
-rw-r--r--app/validators/line_code_validator.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/validators/line_code_validator.rb b/app/validators/line_code_validator.rb
index a351180790e..e1abccc1dff 100644
--- a/app/validators/line_code_validator.rb
+++ b/app/validators/line_code_validator.rb
@@ -7,7 +7,7 @@ class LineCodeValidator < ActiveModel::EachValidator
PATTERN = /\A[a-z0-9]+_\d+_\d+\z/.freeze
def validate_each(record, attribute, value)
- unless value =~ PATTERN
+ unless PATTERN.match?(value)
record.errors.add(attribute, "must be a valid line code")
end
end