diff options
author | gfyoung <gfyoung17@gmail.com> | 2018-07-25 02:30:33 -0700 |
---|---|---|
committer | gfyoung <gfyoung17@gmail.com> | 2018-07-26 16:55:41 -0700 |
commit | 50abbd3e53d4f5e3e67543650a13aca9a54b37c2 (patch) | |
tree | 4b36ec83d974102ab38738b05678e3f0f738a6f3 /app/models/environment.rb | |
parent | caeb4597a5b24e0eaa96b24901ce9208c2eef4bf (diff) | |
download | gitlab-ce-50abbd3e53d4f5e3e67543650a13aca9a54b37c2.tar.gz |
Enable frozen string in app/models/*.rbrepo-forks/gitlab-ce-frozen-string-enable-app-models
Partially addresses #47424.
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r-- | app/models/environment.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb index 4856d313318..c8d1d378ae0 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Environment < ActiveRecord::Base # Used to generate random suffixes for the slug LETTERS = 'a'..'z' @@ -173,7 +175,7 @@ class Environment < ActiveRecord::Base # * cannot end with `-` def generate_slug # Lowercase letters and numbers only - slugified = name.to_s.downcase.gsub(/[^a-z0-9]/, '-') + slugified = +name.to_s.downcase.gsub(/[^a-z0-9]/, '-') # Must start with a letter slugified = 'env-' + slugified unless LETTERS.cover?(slugified[0]) |