diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2017-04-24 13:22:51 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-05-01 12:14:24 +0300 |
commit | ea8e86dac856fdf6545e020df346533231379b93 (patch) | |
tree | 2309bba6e9dff9f91cc0fbb4a90fd374550c165e /app/validators/dynamic_path_validator.rb | |
parent | 39efd0c03018089366d5301583a605626e97e9d7 (diff) |
Use `%r{}` regexes to avoid having to escape `/`
Diffstat (limited to 'app/validators/dynamic_path_validator.rb')
-rw-r--r-- | app/validators/dynamic_path_validator.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/validators/dynamic_path_validator.rb b/app/validators/dynamic_path_validator.rb index 6f04263d4d5..ae2bd5984c5 100644 --- a/app/validators/dynamic_path_validator.rb +++ b/app/validators/dynamic_path_validator.rb @@ -104,7 +104,7 @@ class DynamicPathValidator < ActiveModel::EachValidator end def self.contains_path_part?(path, part) - path =~ /(.*\/|\A)#{Regexp.quote(part)}(\/.*|\z)/ + path =~ %r{(/|\A)#{Regexp.quote(part)}(/|\z)} end def self.follow_format?(value) |